Evaluation of Large Language
Models Trained on CodeSrinivasan Viswanathan
Sbv5221@psu.edu

Overview• Codex – GPT-3 based language model• Scalable sequence prediction• Writes python code given docstrings.
• Codex powers the GIThub co-pilot.
• Solves 29% of the problems with 1 sample per problem.
• 70% with 100 samples per problem.
• Solves very simple problems• Eg., increment a list etc.,• BTW, Codex is deprecated as of last week ! GPT3.5 seems to haveincluded that model or improved on that considerably.

Scalable Sequence Prediction models• Use cases in• NLP• Computer vision• Biology• Audio/Speech• Multi-modal• With this -- > in code generation as well
• More natural fit due to "Coding Language"!
• But has to be very correct - more responsibility unlike a natural language
sentence.

Language Models for code
• Even GPT3 produced some code
• Who knows if they were correct• GPT3.5 - experiment Demo
• It did not work with Incoder• GPT3.5 talked to me on how to run the code !

• Is it due to Reasoning or it is a Large compressed Intelligent semantic
based search engine ?
• Much like any math equation representing a wealth of data related
information in one equation• A neural network model with 170Billion parameters obviously will have lots
more data ?

Problem Solving Capability

How it works ?
• Docstrings --> code
• Code correctness using "Humanval" benchmark• Humanval• 164 hand written programs with unit tests• Assess – language comprehension, algorithm, math, interview (?)• Each problem function, docstring, body, tests,• 7.7 tests per problem.

How it works ? - One sample• To solve a problem• Generate samples Let us say "1"• Check if it passes the humanval unit tests

More Samples• No one gets the code right first time !
• So, they created 100 samples (some of which could be wrong !)• Rationale seems right ?

• But it works ! With that Codex-S solves ie. Generates one correctfunction for 77.5 % of the problems.
• Thoughts !!

• So a programmer model will be – give some input to codex-S, wait for 100
samples, wait for tests, pick the correct one ? Practical? Fast?

• So, now they move to highest mean log-probability (sample that hasone!) now it solves 44.5 % of the problems !

Evaluation Framework – should be right !!
• BLEU – in natural language completion (or samples) match with thehuman sentence and has a value of 0 to 1.
• Programs cannot be verified that way !!
• Sample is correct ONLY WHEN IT WORKS ! Ie., functional correctness.
• What about - non-functional correctness, reliability, scalability, readability,enhancibility, performance, stability etc., ?
• Humans do test driven development !! (I test every 10 lines of code as Idevelop)• Paper introduces a new metric pass@k metric. (what is the merit ofthis metric ?)• Humanval benchmark described in slide 6.

Evaluation Framework – should be right !!
• Pass@k metric !
• Generate "k" samples• Find out which all passes the unit tests• Fraction of the "k" samples that passes is reported.
• Expectation of that random variable is pass@k• There is a math way they calculate (not described here! But described in theappendix of the paper)• Generate "n" samples >= k• Correct samples = 'c'• Pass@k = function_of(n, c, k) --> returns a value between 0 and 1.
• Ie., probability atleast one model is correct.

Evaluation Framework – should be right !!
• Pass@k metric !
• Generate "k" samples• Find out which all passes the unit tests• Fraction of the "k" samples that passes is reported.
• Expectation of that random variable is pass@k• There is a math way they calculate (not described here! But described in theappendix of the paper)• Generate "n" samples >= k
• Correct samples = 'c'• Pass@k = function_of(n, c, k) --> returns a value between 0 and 1.
• Ie., probability atleast one model is correct.

Evaluation Framework – how will you test ?
• Random (may be correct !) code is generated by some hidden
blackbox that is nuclear packed with billions of bits of data from internet !
• Is it trustworthy ?
• Is it secure ?
• Hope data has been cleaned thoroughly in the training set !

• They use "gvisor" a container framework for isolating this process.
• Firewall• Control groups• Resource limitation• Absolutely no visibility of anything outside• Aha.. How will you test client/server programs then ? Wont we generate code forthem ?

Codex – fine tuning• Codex is fine tuned GPT model with 12B parameters.
• Same model parameters as GPT.
• Better tokenizer to accommodate coding languages (eg., large white spaces)• White spaces of different lengths reduced tokens by 30%• Nucleus Sampling (top p=0.95)• Much better performance than GPT

Data Cleaning• Data Collection – cleaning, filtering• Remove the following files:• No automatic generated code (eg., django or oracle sql query in c or python )• Line length > 100• Lower percentage of alphanumerics• Everything similar to what we probably do in a spam email or bad code or corruptionsetc.,• Be ultra careful here !

APPS - (competitive problem solving) dataset• 5000 training, 5000 test/evaluation• Each example includes unit tests• Competitive problems is full program although core is one function• Metrics used for evaluation:• Full correctness/partial correct as well (coding competition test cases onlysome may pass)'• Timeouts may happen.

APPS - Results

Codex-S supervised fine-tuning• Use functional code from competitive programming website,continuous integration website.
• 10000 from competitive websites, 40000 from CI websites.
• Filter those that works well.
• The problems are collected in the same format problem in
docstring, solutions.
• Codex-S performed better, but the pass@k rates for k>1 required
higher temperatures than codex. (Obviously due to codex-S having
more narrower/crisper definitions).

Codex-S results

Codex-S results

Limitations – more components ie. functions

Limitations• Sums of math – binding attributes to objects

Limitations• Over-reliance - has subtle bugs
• Mistakes in training code generate bad code
• Security issues• For developers• Reduce cost of producing s/w• Can focus on value add stuff (say design docs)• Security implications – huge !
• IP issues – who owns the code if same code generated by same s/w intwo companies ?

Future work
• Paper lists• Quantify economic value• Documentation/testing practice• Impact of code generation tools metrics (time saved etc.)• More language grammars insights (?)• My observations• Where is the reasoning here ?
• No wonder having billions of parameters returns better results due to hugeamounts of compressed data inside the model.
• Dynamic code generation library for simple functions …, testing etc. Are more
complex.. More work !