Paper · 2022-12-29 · cs.CL, cs.AI, cs.LG
GPT Takes the Bar Exam
GPT-3.5 (text-davinci-003) answers the multiple-choice MBE part of the US bar exam zero-shot. The best prompt asks for a ranked top three; with temperature, top_p and best_of varied, the authors report 50% first-choice accuracy (25% chance, 68% NCBE student average) and 71%/88% when the top two or three are counted. Fine-tuning gave no gain. Author-reported.
Prompt engineeringLLM evaluationBenchmark validityDecoding strategiesprompt-engineeringzero-shotlegal-nlpmultiple-choicebenchmark-evaluation
arXivPDFCodeMarkdown11 min read
AI-compiled by claude-haiku-5-5 on 2026-11-09, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.
In plain words
A US lawyer must pass a licensing exam, and one large part of it is a set of multiple-choice questions about legal situations. The authors asked a large language model from OpenAI, a general-purpose system with no legal training of its own, to answer those questions. They gave it only the question and the options, with no worked examples.
The model did far better than guessing, and it reached human-level results in some subject areas. It also tended to put the right answer near the top of its ranking, so its first, second or third pick often contained the correct one. The authors tried extra training on example questions, and it did not help. Changing how the question was phrased, and a few sampling settings, did.
The results come from one practice exam bought from the exam's publisher, and the authors say the model's inner workings are hidden, so the reasons for these results are not clear.
TL;DR
Use this card if you want a documented zero-shot evaluation of a closed model on a legal multiple-choice exam. The prompt, the scoring and most parameter ranges are specified, and the released scripts match most of the paper. The exam itself is proprietary and cannot be redistributed, and the code has no license, so only the paper's text may guide reuse. Fine-tuning was tried and not described in enough detail to reproduce.
Problem
Bar exams are hard and costly to pass. The authors ask whether a general
language model can answer such questions without legal fine-tuning
§ Introduction. Prior systems for bar and legal exams needed exam-specific
training § Data. The evaluation is zero-shot, on the proprietary
text-davinci-003 completion endpoint, so the authors have no access to the
model's internals § Introduction § Conclusion and Future Work. The study
covers only the multiple-choice part (MBE) of the exam; the essay and
performance parts are not evaluated § Conclusion and Future Work.
Method
Questions. The evaluation uses the NCBE practice exam and answer key from the MBE Study Aid. It has 200 questions in eight categories of 25 each: seven areas of law and one set of experimental questions § Data tab. 1. The questions and answer key cannot be redistributed; they are sold by NCBE § Data.
Prompt styles. Seven prompt styles were tested § Methods (Prompt Engineering and Responses):
- one answer only;
- one answer with an explanation;
- best and backup answer;
- best and backup answer with an explanation;
- best and backup answer, then a re-prompt between those two (a strike-out step);
- rank all four options;
- rank the top three options.
Style 7 gave the best results and is the main method § Results. The rank-three
prompt asks for three lines, First Choice:, Second Choice: and
Third Choice:, each with one letter, followed by the question and the four
options § Methods (Prompt Engineering and Responses). The authors say results
were broadly similar for most other styles, and they offer no explanation for
why style 7 worked better § Methods (Prompt Engineering and Responses).
Scoring. The reply is parsed line by line. A reply with a natural-language form is also parsed, with exception cases affecting under 1% of replies, and no reply was edited by hand § Methods (Prompt Engineering and Responses). The top-one score uses the first letter. The top-two score counts a hit in either of the first two letters, and the top-three score counts a hit in any of the first three § Results tab. 2.
Sampling parameters. Four API parameters were varied: temperature, top_p, best_of and max_tokens. The ranges are listed under Hyperparameters. Each parameter set was run several times, and the runs were summarised by parameter § Methods (Hyper)parameters § Results § Supplementary Information.
Fine-tuning. The authors fine-tuned the same model on 200 unseen simulated MBE questions, with and without explanations. They trained six models, varying the training prompt, the training response, batch size, learning rate and prompt weighting. All six did significantly worse than the zero-shot model. The authors then stopped fine-tuning because of the scarcity of good data § Methods (Fine-tuning).
# Zero-shot rank-three answering [§ Methods] (Prompt Engineering and Responses)
# Input: one question (stem, four options); one parameter set
# Output: up to three ranked letters, or none
def answer_question(question, params):
# 1. Build the prompt: rank-order instruction, stem, and options A-D
# [code: run_exam.py#L26-L35]
prompt = build_rank_prompt(question)
# 2. Send one zero-shot completion request with the parameter set
# [code: run_exam.py#L121-L125]
reply = complete("text-davinci-003", prompt, **params)
# 3. Parse the First, Second and Third Choice lines into letters
# [code: score_exam.py#L52-L70]
return parse_ranked_letters(reply)# Top-k correctness per question [tab. 2] [code: score_exam.py#L165-L173]
# Input: ranked letters (length 0 to 3), gold letter
# Output: three booleans: top-1, top-2, top-3
def score(ranked, gold):
# 1. A missing or unparsed reply counts as wrong at every k
# [code: score_exam.py#L184-L207]
if not ranked:
return False, False, False
# 2. Top-1 is the first letter
top1 = ranked[0] == gold
# 3. Top-2 is a hit in the first two letters
top2 = gold in ranked[:2]
# 4. Top-3 is a hit in the first three letters
top3 = gold in ranked[:3]
return top1, top2, top3Hyperparameters
| Setting | Value | Source | Notes |
|---|---|---|---|
| Model | text-davinci-003 via the text completion endpoint | § Introduction run_exam.py | Zero-shot; the paper calls it GPT-3.5 |
| Prompt | Rank the top three choices, style 7 | § Methods (Prompt Engineering and Responses) run_exam.py | Wording matches the paper's example |
| temperature | 0.0, 0.5, 1.0 run | run_exam.py; § Supplementary Information | Methods also lists 0.25 and 0.75; see Paper vs code |
| top_p | 0.75, 1.0 | § Methods (Hyper)parameters run_exam.py | Same in both |
| best_of | 1, 2, 4 | § Methods (Hyper)parameters run_exam.py | Server-side choice of the highest log-probability completion § Methods (Hyper)parameters |
| max_tokens | 16 (for prompts without explanation: 16 or 32 in the paper) | § Methods (Hyper)parameters run_exam.py | Code tests 16 only |
| frequency_penalty | 0 | run_exam.py | Not stated in the paper |
| presence_penalty | 0 | run_exam.py | Not stated in the paper |
| Runs per parameter set | 41 runs across combinations for style 7 | § Results | Code default: 3 per set run_exam.py; see Paper vs code |
| Fine-tuning data | 200 unseen simulated MBE questions | § Methods (Fine-tuning) | Explanations included in some runs |
| Fine-tuning settings | Six models: prompt, response, batch size, learning rate, prompt weighting | § Methods (Fine-tuning) | Values not stated; no fine-tuning code in the repository |
| Retry on API error | One retry after 10 seconds | run_exam.py | Paper does not state retries |
| Question text | Text before the first ". " removed from the stem | run_exam.py | Paper does not state it |
| Chance baseline | 25% | § Results | Four options, uniform guessing assumed |
Results
Author-reported. Setup: the NCBE MBE practice exam (200 questions), prompt style 7,
text-davinci-003, and the NCBE student averages from the exam's own statistics
tab. 1. The table is the summary over the 41 style-7 runs, and its averages
are the paper's own tab. 2.
| Category | GPT, first choice | GPT, top two | GPT, top three | NCBE students |
|---|---|---|---|---|
| Evidence | 63% | 84% | 98% | 65% |
| Torts | 62% | 72% | 93% | 71% |
| Civil Procedure | 52% | 63% | 79% | 59% |
| Constitutional Law | 49% | 67% | 87% | 72% |
| Real Property | 45% | 72% | 85% | 65% |
| Contracts | 45% | 77% | 86% | 70% |
| Criminal Law and Procedure | 35% | 62% | 86% | 71% |
| Average | 50% | 71% | 88% | 68% |
Source: tab. 2 for GPT figures; NCBE figures from tab. 1.
| Setting | Metric | Baseline | This paper | Source |
|---|---|---|---|---|
| Whole practice exam (best prompt and parameters) | Correct rate | 25% chance | 50.3% | § Abstract |
| Average over the seven categories | Top-1 / top-2 / top-3 | NCBE students 68% | 50% / 71% / 88% | tab. 2 |
| Temperature 0.0, 0.5, 1.0 | Top-1 / top-2 / top-3 | none | 49.86 / 71.77 / 89.00 (n=5); 50.19 / 71.05 / 88.20 (n=18); 49.79 / 70.65 / 86.95 (n=18) | § Supplementary Information (table by temperature) |
| best_of 1, 2, 4 | Top-1 / top-2 / top-3 | none | 49.51 / 70.59 / 87.27 (n=15); 50.27 / 71.22 / 88.17 (n=14); 50.20 / 71.13 / 87.84 (n=12) | § Supplementary Information (table by best_of) |
| Fine-tuned models (six) | Accuracy | text-davinci-003 zero-shot | Significantly below the zero-shot model; no numbers given | § Methods (Fine-tuning) |
| Prompt style comparison | Accuracy | style 7 | Other styles "did not vary substantially" except style 7 improved correctness substantially; no numbers given | § Methods (Prompt Engineering and Responses) |
The paper's supplementary tables summarise results by temperature and best_of and include a radar figure of the per-category results § Supplementary Information.
Paper vs code
The official repository is https://github.com/mjbommar/gpt-takes-the-bar-exam.
It is linked from the paper's Supplementary Information § Supplementary Information.
The owner is mjbommar, Michael J. Bommarito II, who is an author of the paper
§ Introduction (bibliography, first author). The repository has no LICENSE file
(GitHub reports no license). code_license is recorded as none, and no code was
copied into this card. The commit above is the one cloned on 2026-11-09 with
git clone --depth 1.
The repository has nine files: run_exam.py, score_exam.py,
publication_tables.ipynb, PROMPTS.md, README.md, a parameter summary CSV, two
PNG charts and a sample session log. The fine-tuning code and the question and
answer-key CSVs are not in it. The notebook and session log were not read.
Discrepancies found:
- Temperature grid: the Methods list 0.0, 0.25, 0.5, 0.75 and 1.0 § Methods (Hyper)parameters. The code runs only 0.0, 0.5 and 1.0 run_exam.py, and the supplementary temperature table has the same three values.
- max_tokens: the paper tests 16 and 32 for prompts without explanation § Methods (Hyper)parameters. The code fixes 16 for all runs run_exam.py.
- Number of runs: the code's grid is 3 temperatures × 2 top_p × 3 best_of, with 3 samples per set run_exam.py run_exam.py. That gives 54 sessions. The paper reports 41 runs for style 7 § Results. The paper does not explain the gap. The supplementary tables give 5, 18 and 18 runs by temperature and 15, 14 and 12 by best_of, both totalling 41.
- Parser exceptions: the paper says natural-language replies were handled by
exception cases § Methods (Prompt Engineering and Responses). The released
parser only reads lines that start with
First Choice,Second ChoiceorThird Choice, and has no alternative branch score_exam.py. A reply such as "My first choice is (D)" would give no letter and score as wrong. Whether the reported numbers used a different parser is not stated. - Failed requests: the code retries once after 10 seconds and then records no response run_exam.py. The scorer counts such a question as wrong at every k and keeps it in the denominator score_exam.py. The paper does not say how failures were handled.
- Penalties: the code fixes frequency_penalty and presence_penalty at 0 run_exam.py. The paper does not mention them.
- Question text: the code drops everything before the first ". " in the question prompt run_exam.py. The paper does not describe this step.
- Prompt wording: the rank-three prompt matches the paper's example text run_exam.py § Methods (Prompt Engineering and Responses).
- Model call: the code uses the legacy
openai.Completion.createcall withmodel="text-davinci-003"run_exam.py. This matches the paper. - Scorer bugs, not expected to affect the reported runs: the multi-choice branch
reads
question['category']andquestion['number'], which are not top-level keys score_exam.py. The missing-key check compares a tuple to 0, so it never fires score_exam.py. Withbest_of, the API returns one choice, so the multi-choice branch is not expected to run.
Pitfalls
- "Passing" means a score band, not beating students. The paper says GPT "reached the average passing rate" for Evidence and Torts § Results. Its footnote gives the passing band as 58-62% on the multiple-choice section § Results (footnote). Evidence at 63% and Torts at 62% fall in that band, but both are below the NCBE student averages in the same table tab. 2.
- The headline 50.3% is not tied to one setting. The abstract gives 50.3% for "best prompt and parameters" § Abstract. The exact combination is not stated. The best_of = 2 row averages 50.27% § Supplementary Information, which may be the source, but the paper does not say so.
- The top-two and top-three numbers come from one reply. They are prefixes of the same ranked output, not separate runs or separate prompts. A top-three hit is therefore a property of the ranking, and it is generous when a question has several plausible answers.
- Averages and their definitions are not given. The paper does not say whether the 50% and 68% averages are unweighted across the seven categories or weighted by questions. It does not say whether the experimental category was scored in the 50.3% headline. Each category has 25 questions, so a single run's category result moves in steps of 4 points.
- The text and table disagree slightly. The text says GPT trails human test-takers by "approximately 17%" § Results. The table averages differ by 18 points tab. 2. The paper does not explain the gap.
- Prompt and parameter choice may be optimistic. The best style and parameters were picked from runs on the same practice exam that the headline numbers come from § Results § Data. The paper does not describe a separate selection split.
- Run counts are unbalanced. The supplementary runs range from 5 to 18 per temperature and from 12 to 15 per best_of value § Supplementary Information. Differences of a point or two between rows are within this noise, and the paper gives no uncertainty estimates for the averages.
- The paper's own temperature claim. The Methods say temperature 0.0 is deterministic § Methods (Hyper)parameters. The paper does not check how repeatable its 0.0 runs were, and the 0.0 row has only 5 runs.
- The model is a moving target. It is a hosted, proprietary model. The authors
note that papers describing it may no longer match the current service
§ Introduction. A rerun needs the same endpoint version, and the paper does
not name one beyond
text-davinci-003. - Contamination is argued, not measured. The authors chose this PDF because they judged prior exposure unlikely § Data. They do not test for overlap with training data.
- The question set cannot be shared. Reproduction needs a purchased copy of the
NCBE MBE Study Aid. The paper gives an approximate price of 300 USD
§ Data. The repository reads the questions and answer key from
../data/, which is not in it run_exam.py score_exam.py. - Fine-tuning cannot be reproduced from the paper. Batch size, learning rate and prompt weighting are named but not given, and the training code is absent from the repository § Methods (Fine-tuning).
- Parser and missing replies can change scores. Under-1% parser exceptions and failed requests both count as wrong, so the reported numbers depend on the parser and retry logic the authors actually ran.
- Parameter names are the API's. The authors describe best_of as a server-side choice of the highest log-probability completion § Methods (Hyper)parameters. A reimplementation must call the same endpoint, because a local model does not have this option.
Lineage
- Builds on: GPT-3 and its successors, from Brown et al. 2020 ("Language models are few-shot learners") § Introduction (bibliography, entry 17). Not carded in this wiki.
- Compared against: NCBE-reported student averages by category tab. 1. Earlier bar-exam systems by Wyner et al. (2016), the COLIEE 2018 legal competition (Kano et al., 2019) and JEC-QA (Zhong et al., 2020) are named but not compared numerically § Data.
- Companion work: the authors plan to test other open models, and the essay and performance parts of the exam, in future work § Conclusion and Future Work.
- Superseded by: not known from content in this wiki.
Source and license
Adapted from “GPT Takes the Bar Exam” by Michael Bommarito, Daniel Martin Katz (arXiv:2212.14402), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors. Code citations refer to https://github.com/mjbommar/gpt-takes-the-bar-exam at commit f20fc42e9e0d (none (no LICENSE file in the repository)). Any quoted code is shown under that license.