Fine-tuning CodeLlama-7B on Synthetic Training Data for Fortran Code Generation using PEFT

Soham Govande, Taeuk Kang, Andrew Shi

Stanford University

Our model CodeLlama-7B
ID Title Compiled Executed Correct Compiled Executed Correct
1 Two Sum
9 Palindrome Number
13 Roman to Integer
14 Longest Common Prefix
20 Valid Parentheses ⚠️
21 Merge Two Sorted Lists
26 Remove Duplicates from Sorted Array
27 Remove Element
28 Find the Index of the First Occurrence in a String
35 Search Insert Position
58 Length of Last Word
66 Plus One
67 Add Binary
69 Sqrt(x) ⚠️
70 Climbing Stairs
83 Remove Duplicates from Sorted List
88 Merge Sorted Array
94 Binary Tree Inorder Traversal
100 Same Tree
101 Symmetric Tree
104 Maximum Depth of Binary Tree
108 Convert Sorted Array to Binary Search Tree
110 Balanced Binary Tree
111 Minimum Depth of Binary Tree
112 Path Sum
118 Pascal's Triangle
119 Pascal's Triangle II
121 Best Time to Buy and Sell Stock
125 Valid Palindrome ⚠️
136 Single Number
141 Linked List Cycle
144 Binary Tree Preorder Traversal
145 Binary Tree Postorder Traversal
157 Read N Characters Given Read4
160 Intersection of Two Linked Lists ⚠️
163 Missing Ranges ⚠️
168 Excel Sheet Column Title
169 Majority Element
170 Two Sum III - Data structure design
171 Excel Sheet Column Number
190 Reverse Bits
191 Number of 1 Bits
202 Happy Number
203 Remove Linked List Elements
205 Isomorphic Strings ⚠️
206 Reverse Linked List ⚠️
217 Contains Duplicate
219 Contains Duplicate II
225 Implement Stack using Queues
226 Invert Binary Tree
228 Summary Ranges
231 Power of Two ⚠️
232 Implement Queue using Stacks
234 Palindrome Linked List ⚠️
242 Valid Anagram
243 Shortest Word Distance
246 Strobogrammatic Number
252 Meeting Rooms
257 Binary Tree Paths
258 Add Digits
263 Ugly Number
266 Palindrome Permutation
268 Missing Number
270 Closest Binary Search Tree Value
278 First Bad Version
283 Move Zeroes
290 Word Pattern
292 Nim Game
293 Flip Game
303 Range Sum Query - Immutable
326 Power of Three
338 Counting Bits
342 Power of Four ⚠️
344 Reverse String
345 Reverse Vowels of a String
346 Moving Average from Data Stream
349 Intersection of Two Arrays
350 Intersection of Two Arrays II
359 Logger Rate Limiter
367 Valid Perfect Square
374 Guess Number Higher or Lower
383 Ransom Note
387 First Unique Character in a String ⚠️
389 Find the Difference
392 Is Subsequence ⚠️
401 Binary Watch
404 Sum of Left Leaves
405 Convert a Number to Hexadecimal
408 Valid Word Abbreviation
409 Longest Palindrome
412 Fizz Buzz
414 Third Maximum Number
415 Add Strings
422 Valid Word Square
434 Number of Segments in a String
441 Arranging Coins
448 Find All Numbers Disappeared in an Array
455 Assign Cookies
459 Repeated Substring Pattern ⚠️
461 Hamming Distance
463 Island Perimeter
476 Number Complement
482 License Key Formatting
485 Max Consecutive Ones
492 Construct the Rectangle
495 Teemo Attacking
496 Next Greater Element I
500 Keyboard Row
501 Find Mode in Binary Search Tree
504 Base 7
506 Relative Ranks
507 Perfect Number
509 Fibonacci Number
520 Detect Capital ⚠️
521 Longest Uncommon Subsequence I
530 Minimum Absolute Difference in BST
541 Reverse String II
543 Diameter of Binary Tree
551 Student Attendance Record I
557 Reverse Words in a String III
559 Maximum Depth of N-ary Tree
561 Array Partition
563 Binary Tree Tilt
566 Reshape the Matrix
572 Subtree of Another Tree
575 Distribute Candies
589 N-ary Tree Preorder Traversal
590 N-ary Tree Postorder Traversal
594 Longest Harmonious Subsequence
598 Range Addition II
599 Minimum Index Sum of Two Lists
604 Design Compressed String Iterator
605 Can Place Flowers ⚠️
606 Construct String from Binary Tree
617 Merge Two Binary Trees
628 Maximum Product of Three Numbers
637 Average of Levels in Binary Tree
643 Maximum Average Subarray I
645 Set Mismatch
653 Two Sum IV - Input is a BST
657 Robot Return to Origin
661 Image Smoother
671 Second Minimum Node In a Binary Tree
674 Longest Continuous Increasing Subsequence
680 Valid Palindrome II
682 Baseball Game
693 Binary Number with Alternating Bits
696 Count Binary Substrings
697 Degree of an Array
700 Search in a Binary Search Tree
703 Kth Largest Element in a Stream
704 Binary Search
705 Design HashSet
706 Design HashMap
709 To Lower Case
717 1-bit and 2-bit Characters ⚠️
724 Find Pivot Index
728 Self Dividing Numbers
733 Flood Fill
734 Sentence Similarity
744 Find Smallest Letter Greater Than Target
746 Min Cost Climbing Stairs
747 Largest Number At Least Twice of Others
748 Shortest Completing Word
760 Find Anagram Mappings
762 Prime Number of Set Bits in Binary Representation
766 Toeplitz Matrix
771 Jewels and Stones
783 Minimum Distance Between BST Nodes
796 Rotate String
800 Similar RGB Color
804 Unique Morse Code Words
806 Number of Lines To Write String
812 Largest Triangle Area
819 Most Common Word
821 Shortest Distance to a Character
824 Goat Latin
830 Positions of Large Groups
832 Flipping an Image
836 Rectangle Overlap
844 Backspace String Compare ⚠️
859 Buddy Strings
860 Lemonade Change
867 Transpose Matrix
868 Binary Gap
872 Leaf-Similar Trees
876 Middle of the Linked List
883 Projection Area of 3D Shapes
884 Uncommon Words from Two Sentences
888 Fair Candy Swap
892 Surface Area of 3D Shapes
896 Monotonic Array
897 Increasing Order Search Tree
905 Sort Array By Parity
908 Smallest Range I
914 X of a Kind in a Deck of Cards
917 Reverse Only Letters
922 Sort Array By Parity II
925 Long Pressed Name
929 Unique Email Addresses
933 Number of Recent Calls
938 Range Sum of BST
941 Valid Mountain Array
942 DI String Match
944 Delete Columns to Make Sorted
953 Verifying an Alien Dictionary
961 N-Repeated Element in Size 2N Array
965 Univalued Binary Tree
976 Largest Perimeter Triangle
977 Squares of a Sorted Array
989 Add to Array-Form of Integer
993 Cousins in Binary Tree
997 Find the Town Judge
999 Available Captures for Rook
1002 Find Common Characters
1005 Maximize Sum Of Array After K Negations
1009 Complement of Base 10 Integer
1013 Partition Array Into Three Parts With Equal Sum
1018 Binary Prefix Divisible By 5
1021 Remove Outermost Parentheses ⚠️
1022 Sum of Root To Leaf Binary Numbers
1025 Divisor Game
1030 Matrix Cells in Distance Order
1037 Valid Boomerang
1046 Last Stone Weight
1047 Remove All Adjacent Duplicates In String
1051 Height Checker
1056 Confusing Number
1064 Fixed Point
1065 Index Pairs of a String
1071 Greatest Common Divisor of Strings
1078 Occurrences After Bigram
1085 Sum of Digits in the Minimum Number ⚠️
1086 High Five
1089 Duplicate Zeros
1099 Two Sum Less Than K
1103 Distribute Candies to People
1108 Defanging an IP Address
1118 Number of Days in a Month ⚠️
1119 Remove Vowels from a String
1122 Relative Sort Array
1128 Number of Equivalent Domino Pairs
1133 Largest Unique Number
1134 Armstrong Number
1137 N-th Tribonacci Number
1150 Check If a Number Is Majority Element in a Sorted Array
1154 Day of the Year
1160 Find Words That Can Be Formed by Characters
1165 Single-Row Keyboard
1175 Prime Arrangements
1176 Diet Plan Performance
1180 Count Substrings with Only One Distinct Letter
1184 Distance Between Bus Stops
1185 Day of the Week
1189 Maximum Number of Balloons
1196 How Many Apples Can You Put into the Basket
1200 Minimum Absolute Difference
1207 Unique Number of Occurrences
1213 Intersection of Three Sorted Arrays
1217 Minimum Cost to Move Chips to The Same Position
1221 Split a String in Balanced Strings
1228 Missing Number In Arithmetic Progression
1232 Check If It Is a Straight Line
1243 Array Transformation
1252 Cells with Odd Values in a Matrix
1260 Shift 2D Grid
1266 Minimum Time Visiting All Points
1271 Hexspeak
1275 Find Winner on a Tic Tac Toe Game
1281 Subtract the Product and Sum of Digits of an Integer
1287 Element Appearing More Than 25% In Sorted Array
1290 Convert Binary Number in a Linked List to Integer
1295 Find Numbers with Even Number of Digits
1299 Replace Elements with Greatest Element on Right Side
1304 Find N Unique Integers Sum up to Zero
1309 Decrypt String from Alphabet to Integer Mapping
1313 Decompress Run-Length Encoded List
1317 Convert Integer to the Sum of Two No-Zero Integers ⚠️ ⚠️
1323 Maximum 69 Number
1331 Rank Transform of an Array
1332 Remove Palindromic Subsequences
1337 The K Weakest Rows in a Matrix
1342 Number of Steps to Reduce a Number to Zero
1346 Check If N and Its Double Exist
1351 Count Negative Numbers in a Sorted Matrix
1356 Sort Integers by The Number of 1 Bits
1360 Number of Days Between Two Dates ⚠️
1365 How Many Numbers Are Smaller Than the Current Number
1370 Increasing Decreasing String
1374 Generate a String With Characters That Have Odd Counts
1379 Find a Corresponding Node of a Binary Tree in a Clone of That Tree
1380 Lucky Numbers in a Matrix
1385 Find the Distance Value Between Two Arrays
1394 Find Lucky Integer in an Array
1399 Count Largest Group
1403 Minimum Subsequence in Non-Increasing Order
1408 String Matching in an Array
1413 Minimum Value to Get Positive Step by Step Sum
1417 Reformat The String
1422 Maximum Score After Splitting a String
1426 Counting Elements
1427 Perform String Shifts
1431 Kids With the Greatest Number of Candies
1436 Destination City
1437 Check If All 1's Are at Least Length K Places Away
1446 Consecutive Characters
1450 Number of Students Doing Homework at a Given Time
1455 Check If a Word Occurs As a Prefix of Any Word in a Sentence
1460 Make Two Arrays Equal by Reversing Subarrays
1464 Maximum Product of Two Elements in an Array
1469 Find All The Lonely Nodes
1470 Shuffle the Array
1474 Delete N Nodes After M Nodes of a Linked List
1475 Final Prices With a Special Discount in a Shop
1480 Running Sum of 1d Array
1486 XOR Operation in an Array
1491 Average Salary Excluding the Minimum and Maximum Salary
1496 Path Crossing ⚠️
1502 Can Make Arithmetic Progression From Sequence ⚠️
1507 Reformat Date
1512 Number of Good Pairs
1518 Water Bottles
1523 Count Odd Numbers in an Interval Range
1528 Shuffle String
1534 Count Good Triplets
1539 Kth Missing Positive Number
1544 Make The String Great
1550 Three Consecutive Odds ⚠️
1556 Thousand Separator
1560 Most Visited Sector in a Circular Track
1566 Detect Pattern of Length M Repeated K or More Times
1572 Matrix Diagonal Sum
1576 Replace All ?'s to Avoid Consecutive Repeating Characters
1582 Special Positions in a Binary Matrix
1588 Sum of All Odd Length Subarrays
1592 Rearrange Spaces Between Words
1598 Crawler Log Folder
1603 Design Parking System
1608 Special Array With X Elements Greater Than or Equal X
1614 Maximum Nesting Depth of the Parentheses
1619 Mean of Array After Removing Some Elements
1624 Largest Substring Between Two Equal Characters
1629 Slowest Key
1636 Sort Array by Increasing Frequency
1640 Check Array Formation Through Concatenation
1646 Get Maximum in Generated Array ⚠️
1652 Defuse the Bomb
1656 Design an Ordered Stream
1662 Check If Two String Arrays are Equivalent
1668 Maximum Repeating Substring
1672 Richest Customer Wealth
1678 Goal Parser Interpretation
1684 Count the Number of Consistent Strings
1688 Count of Matches in Tournament
1694 Reformat Phone Number
1700 Number of Students Unable to Eat Lunch
1704 Determine if String Halves Are Alike
1708 Largest Subarray Length K
1710 Maximum Units on a Truck
1716 Calculate Money in Leetcode Bank
1720 Decode XORed Array
1725 Number Of Rectangles That Can Form The Largest Square
1732 Find the Highest Altitude
1736 Latest Time by Replacing Hidden Digits
1742 Maximum Number of Balls in a Box
1748 Sum of Unique Elements
1752 Check if Array Is Sorted and Rotated ⚠️
1758 Minimum Changes To Make Alternating Binary String
1763 Longest Nice Substring
1768 Merge Strings Alternately
1773 Count Items Matching a Rule
1779 Find Nearest Point That Has the Same X or Y Coordinate
1784 Check if Binary String Has at Most One Segment of Ones ⚠️
1790 Check if One String Swap Can Make Strings Equal ⚠️
1791 Find Center of Star Graph
1796 Second Largest Digit in a String
1800 Maximum Ascending Subarray Sum
1805 Number of Different Integers in a String
1812 Determine Color of a Chessboard Square
1816 Truncate Sentence
1822 Sign of the Product of an Array
1826 Faulty Sensor
1827 Minimum Operations to Make the Array Increasing
1832 Check if the Sentence Is Pangram
1837 Sum of Digits in Base K
1844 Replace All Digits with Characters
1848 Minimum Distance to the Target Element
1854 Maximum Population Year
1859 Sorting the Sentence
1863 Sum of All Subset XOR Totals
1869 Longer Contiguous Segments of Ones than Zeros ⚠️
1876 Substrings of Size Three with Distinct Characters
1880 Check if Word Equals Summation of Two Words ⚠️
1886 Determine Whether Matrix Can Be Obtained By Rotation
1893 Check if All the Integers in a Range Are Covered ⚠️
1897 Redistribute Characters to Make All Strings Equal
1903 Largest Odd Number in String
1909 Remove One Element to Make the Array Strictly Increasing
1913 Maximum Product Difference Between Two Pairs
1920 Build Array from Permutation
1925 Count Square Sum Triples
1929 Concatenation of Array
1933 Check if String Is Decomposable Into Value-Equal Substrings
1935 Maximum Number of Words You Can Type
1941 Check if All Characters Have Equal Number of Occurrences
1945 Sum of Digits of String After Convert
1952 Three Divisors ⚠️
1957 Delete Characters to Make Fancy String
1961 Check If String Is a Prefix of Array
1967 Number of Strings That Appear as Substrings in Word
1971 Find if Path Exists in Graph
1974 Minimum Time to Type Word Using Special Typewriter
1979 Find Greatest Common Divisor of Array
1984 Minimum Difference Between Highest and Lowest of K Scores
1991 Find the Middle Index in Array
2000 Reverse Prefix of Word
2006 Count Number of Pairs With Absolute Difference K ⚠️
2011 Final Value of Variable After Performing Operations
2016 Maximum Difference Between Increasing Elements
2022 Convert 1D Array Into 2D Array
2027 Minimum Moves to Convert String
2032 Two Out of Three
2037 Minimum Number of Moves to Seat Everyone
2042 Check if Numbers Are Ascending in a Sentence
2047 Number of Valid Words in a Sentence
2053 Kth Distinct String in an Array
2057 Smallest Index With Equal Value
2062 Count Vowel Substrings of a String
2068 Check Whether Two Strings are Almost Equivalent
2073 Time Needed to Buy Tickets
2078 Two Furthest Houses With Different Colors
2085 Count Common Words With One Occurrence
2089 Find Target Indices After Sorting Array
2094 Finding 3-Digit Even Numbers
2099 Find Subsequence of Length K With the Largest Sum
2103 Rings and Rods
2108 Find First Palindromic String in the Array
2114 Maximum Number of Words Found in Sentences
2119 A Number After a Double Reversal ⚠️
2124 Check if All A's Appears Before All B's
2129 Capitalize the Title
2133 Check if Every Row and Column Contains All Numbers
2138 Divide a String Into Groups of Size k ⚠️
2144 Minimum Cost of Buying Candies With Discount
2148 Count Elements With Strictly Smaller and Greater Elements ⚠️
2154 Keep Multiplying Found Values by Two
2160 Minimum Sum of Four Digit Number After Splitting Digits
2164 Sort Even and Odd Indices Independently
2176 Count Equal and Divisible Pairs in an Array
2180 Count Integers With Even Digit Sum
2185 Counting Words With a Given Prefix
2190 Most Frequent Number Following Key In an Array
2194 Cells in a Range on an Excel Sheet
2200 Find All K-Distant Indices in an Array
2206 Divide Array Into Equal Pairs
2210 Count Hills and Valleys in an Array
2215 Find the Difference of Two Arrays
2220 Minimum Bit Flips to Convert Number
2224 Minimum Number of Operations to Convert Time
2229 Check if an Array Is Consecutive
2231 Largest Number After Digit Swaps by Parity
2235 Add Two Integers
2236 Root Equals Sum of Children
2239 Find Closest Number to Zero
2243 Calculate Digit Sum of a String
2248 Intersection of Multiple Arrays
2255 Count Prefixes of a Given String
2259 Remove Digit From Number to Maximize Result
2264 Largest 3-Same-Digit Number in String
2269 Find the K-Beauty of a Number
2273 Find Resultant Array After Removing Anagrams
2278 Percentage of Letter in String
2283 Check if Number Has Equal Digit Count and Digit Value
2287 Rearrange Characters to Make Target String
2299 Strong Password Checker II
2303 Calculate Amount Paid in Taxes
2309 Greatest English Letter in Upper and Lower Case
2315 Count Asterisks ⚠️
2319 Check if Matrix Is X-Matrix
2325 Decode the Message
2331 Evaluate Boolean Binary Tree
2335 Minimum Amount of Time to Fill Cups ⚠️
2341 Maximum Number of Pairs in Array
2347 Best Poker Hand
2351 First Letter to Appear Twice
2357 Make Array Zero by Subtracting Equal Amounts
2363 Merge Similar Items
2367 Number of Arithmetic Triplets ⚠️
2373 Largest Local Values in a Matrix ⚠️
2379 Minimum Recolors to Get K Consecutive Black Blocks
2383 Minimum Hours of Training to Win a Competition
2389 Longest Subsequence With Limited Sum
2395 Find Subarrays With Equal Sum
2399 Check Distances Between Same Letters
2404 Most Frequent Even Element
2409 Count Days Spent Together
2413 Smallest Even Multiple
2418 Sort the People ⚠️
2423 Remove Letter To Equalize Frequency
2427 Number of Common Factors
2432 The Employee That Worked on the Longest Task
2437 Number of Valid Clock Times
2441 Largest Positive Integer That Exists With Its Negative
2446 Determine if Two Events Have Conflict ⚠️
2451 Odd String Difference
2455 Average Value of Even Numbers That Are Divisible by Three
2460 Apply Operations to an Array
2465 Number of Distinct Averages
2469 Convert the Temperature
2475 Number of Unequal Triplets in Array
2481 Minimum Cuts to Divide a Circle
2485 Find the Pivot Integer ⚠️
2490 Circular Sentence
2496 Maximum Value of a String in an Array
2500 Delete Greatest Value in Each Row
2506 Count Pairs Of Similar Strings
2511 Maximum Enemy Forts That Can Be Captured
2515 Shortest Distance to Target String in a Circular Array
2520 Count the Digits That Divide a Number
2525 Categorize Box According to Criteria
2529 Maximum Count of Positive Integer and Negative Integer
2535 Difference Between Element Sum and Digit Sum of an Array
2540 Minimum Common Value
2544 Alternating Digit Sum
2549 Count Distinct Numbers on Board
2553 Separate the Digits in an Array
2558 Take Gifts From the Richest Pile
2562 Find the Array Concatenation Value
2566 Maximum Difference by Remapping a Digit
2570 Merge Two 2D Arrays by Summing Values
2574 Left and Right Sum Differences
2578 Split With Minimum Sum
2582 Pass the Pillow
2586 Count the Number of Vowel Strings in Range
2591 Distribute Money to Maximum Children
2595 Number of Even and Odd Bits
2600 K Items With the Maximum Sum ⚠️
2605 Form Smallest Number From Two Digit Arrays
2609 Find the Longest Balanced Substring of a Binary String