Talk to our team
Menu

BERT-as-a-Judge: A Robust Alternative to Lexical Methods for Efficient Reference-Based LLM Evaluation

Authors
  • Hippolyte Gisserot-Boukhlef
  • Nicolas Boizard
  • Emmanuel Malherbe
  • Celine Hudelot
  • Pierre Colombo
Affiliations
  • Artefact Research Center
  • Diabolocom
  • Cohere
  • MICS, CentraleSupélec, Université Paris-Saclay
Accepted at
COLM 2026
Date
arXiv
2604.09497

Abstract

Accurate evaluation is central to the large language model (LLM) ecosystem, guiding model selection and downstream adoption across diverse use cases. In practice, however, evaluating generative outputs typically relies on rigid lexical methods to extract and assess answers, which can conflate a model's true problem-solving ability with its compliance with predefined formatting guidelines. While recent LLM-as-a-Judge approaches mitigate this issue by assessing semantic correctness rather than strict structural conformity, they also introduce substantial computational overhead, making evaluation costly. In this work, we first systematically investigate the limitations of lexical evaluation through a largescale empirical study spanning 36 models and 15 downstream tasks, demonstrating that such methods correlate poorly with human judgments. To address this limitation, we introduce BERT-as-a-Judge, an encoder-driven approach for assessing answer correctness in reference-based generative settings, robust to variations in output phrasing, and requiring only lightweight training on synthetically annotated question-candidate-reference triplets. We show that it consistently outperforms the lexical baseline while matching the performance of much larger LLM judges, providing a compelling tradeoff between the two and enabling reliable, scalable evaluation. Finally, through extensive experimentation, we provide detailed insights into BERT-as-a-Judge's performance to offer practical guidance for practitioners, and release all project artifacts to foster downstream adoption.

Cite this paper

@inproceedings{gisserotboukhlef2026bertasajudge,
  title = {BERT-as-a-Judge: A Robust Alternative to Lexical Methods for Efficient Reference-Based LLM Evaluation},
  author = {Hippolyte Gisserot-Boukhlef and Nicolas Boizard and Emmanuel Malherbe and Celine Hudelot and Pierre Colombo},
  booktitle = {Conference on Language Modeling (COLM 2026)},
  year = {2026}
}

Introduction

Evaluation lies at the core of the large language model (LLM) ecosystem. In recent years, considerable effort has been devoted to rigorously and fairly assessing model performance across a wide range of tasks, to guide model selection and downstream adoption [1, 2]. For instruction-tuned models (optimized for human interaction and question answering), evaluation is typically conducted in zero-shot generative settings [3, 4], in which models are prompted to directly generate an answer without access to task-specific examples.

While conceptually straightforward, this setup poses two challenges for evaluation: reliably extracting the model's predicted answer for comparison with a reference, and performing the comparison itself. The former arises from answer formatting variations, such as "The answer is X" versus "Answer: X", the latter occurs when comparing outputs like "2.00" versus "2$", both of which should be treated as equivalent. A common mitigation strategy is to enforce constrained output formats via prompting, enabling answers to be extracted with regular expressions (regex) [5, 6], and then rely on metrics beyond exact match, such as ROUGE [7], BERTScore [8], or Math-Verify [9], thereby avoiding errors caused by formatting inconsistencies or lexical variations. Although more flexible than strict exact match, these metrics can still fail to accurately capture answer correctness, especially since models often do not strictly follow prescribed output formats, making reliable answer parsing difficult. Such deviations may stem from differences in model scale, instruction-tuning data mixtures, or alignment strategies, and can artificially deflate measured downstream performance. While formatting adherence is itself an important capability, particularly for instruction following and structured generation [4], it should not confound the evaluation of orthogonal competencies such as factual knowledge, mathematical reasoning, or reading comprehension [10, 11].

Recently, LLM-as-a-Judge frameworks have emerged as a compelling alternative [12, 13]. By delegating answer comparison to a separate language model, these approaches reduce dependence on rigid formatting constraints and can correctly credit semantically valid but structurally unconventional responses. However, they introduce substantial computational overhead and additional sources of variance, including sensitivity to the choice of judge model and prompt design [14].

Question. How can we measure a model's core problem-solving ability without relying on output formatting or expensive inference?

Contributions. In this work, we make the following three contributions:

Through a comprehensive empirical study across a diverse set of models and tasks, we show that lexical evaluation exhibits weak correlation with human judgments (section 3).

To address this limitation, we introduce BERT-as-a-Judge, an encoder-driven approach for evaluating generative models in reference-based settings, leveraging the strength of bidirectional attention for text classification (Figure 1). We show that BERT-as-a-Judge consistently outperforms lexical evaluation and even surpasses LLM-as-a-Judge under comparable inference conditions (section 4).

We provide detailed insights into BERT-as-a-Judge’s performance through an extensive set of experiments, offering practical guidance for downstream applications (section 5). Additionally, we release the packaged code (https://github.com/artefactory/BERT-as-a-Judge) along with the full set of generated and annotated data, covering outputs from 36 models across 15 tasks, and open-source all post fine-tuning checkpoints used in our experiments (https://huggingface.co/collections/artefactory/bert-as-a-judge).

Experimental Protocol

Answer Generation

Tasks. The backbone of LLM evaluation consists of tasks whose outputs can be unambiguously judged as correct or incorrect, providing an objective basis for model assessment [15, 16, 17, 18, 19]. In this work, we focus on three families of widely used benchmarks:

Multiple-choice, in which models are given a question along with a set of options: MMLU [10], MMLU-Pro [20], TruthfulQA [21], ARC-Easy/Challenge [22], and GPQA [23].

Context extraction, where models must provide answers grounded in a given passage by citing relevant evidence: SQuAD-v2 [24], HotpotQA [25], DROP [26], and CoQA [27].

Open-form mathematics, in which models generate a final closed-form answer in free text: GSM8K [11], MATH [28], AsDiv [29], AIME 24 [30], and AIME 25 [31].

Models. We perform inference across a broad range of recent open-weight instruction-tuned model families, spanning from 135M to 70B parameters. Our study includes 36 models in total: Llama-3 (1B, 3B, 8B, 70B) [15], Qwen-3 (600M, 4B, 8B, 14B, 32B) [16], Gemma-3 (1B, 4B, 12B, 27B) [32], Falcon-3 (1B, 3B, 7B) [33], Phi-4 (3.8B, 14B) [34, 35], SmolLM-2 and 3 (135M, 360M, 1.7B, 3B) [36, 37], OLMo-3 (7B, 32B) [17], Ministral-3 (3B, 8B, 14B) [38], LFM-2 (350M, 700M, 1.2B, 2.6B) [38], EuroLLM (1.7B, 9B, 22B) [39, 40, 18], and Apertus (8B, 70B) [19].

Generation parameters. For each task-model pair, responses are produced in a zero-shot setting using greedy decoding, with a maximum generation length of 2048 tokens. For experimental purposes, models are prompted to conclude their outputs in the format "Final answer: [answer]" to facilitate downstream regex parsing and ensure fair comparison between model- and regex-based assessment methods.

Labeling

Synthetic labeling. For annotation, we employ Nemotron-Super-v1.5 [41] as an automatic evaluator. The model is provided with the question, the candidate answer, and the reference answer, and is asked to determine whether the candidate response is correct given the available information. Inference is conducted using greedy decoding in non-reasoning mode.

Human labeling. To validate the reliability of the synthetic labeling approach, we perform human annotation on a subset of the data. Specifically, we randomly sample instances from the generated dataset and have them independently labeled by a pool of 11 human evaluators, totaling 3,212 annotations, and resulting in an overall average agreement of 97.5% with the synthetic labels.

Evaluation Methods

BERT-as-a-Judge. We propose to train a BERT-like encoder model on labeled question-candidatereference triplets constructed as described in subsection 2.1 and subsection 2.2, leveraging its bidirectional attention mechanism well suited for structured text classification [42]. We construct the training mixture from the tasks described in subsection 2.1 that provide an explicit training split, namely MMLU, ARC-Easy, ARC-Challenge, SQuAD-v2, HotpotQA, GSM8K, and Math. The training dataset is constructed to balance the number of samples across task categories and models, resulting in approximately 1M synthetically labeled samples in total. We initialize the encoder from EuroBERT 210M [43] and fine-tune it for one epoch using binary cross-entropy. We employ a learning rate of 2 ×10−5, following the authors’ recommendations for sequence classification, along with a 5% warmup ratio and a linear decay schedule. Training is conducted on 8 MI250x GPUs, yielding an effective batch size of 32, taking approximately 20 GPU hours per run.

Baselines. We compare BERT-as-a-Judge to the following baselines:

Regex: Extracts answers using a regular expression based on the pattern "Final answer: [answer]" and evaluates multiple-choice tasks with exact match, context extraction with ROUGE-L [7], and open-form math with Math-Verify [9]. For answer parsing, we build on the regex rules provided by the lm-evaluation-harness framework [6], adapting them to our prompting format and the range of evaluated models.

LLM-as-a-Judge: Uses a generative model to determine whether a candidate response matches the reference answer for a given question, following the procedure described in subsection 2.1. To keep inference costs comparable to the encoder, we use a model of similar scale by default (Qwen-3 0.6B), prompting it to respond directly with "True" or "False". Larger LLM judges and more flexible prompting strategies are also evaluated in section 5.

Assessment of Evaluation Quality

Metric. We assess each method by its accuracy against synthetic labels from Nemotron-Super-v1.5, reflecting how well it predicts whether a given answer is correct or incorrect.

Benchmarks. We assess all evaluation methods on the full set of tasks introduced in subsection 2.1, including both the test splits of tasks used during encoder training (subsection 2.3) and the tasks reserved exclusively for out-of-domain evaluation.

Comparison between regex-based (lexical) evaluation and BERT-as-a-Judge.
Figure 1. Comparison between regex-based (lexical) evaluation and BERT-as-a-Judge. Top: illustration of both approaches with simple examples. Bottom: model rankings for four similarly sized models from different families, computed via task-wise Borda count.

Limitations of Regex-Based Evaluation

This section analyzes the impact of regex-based evaluation on measured downstream performance, noting discrepancies from both formatting-related parsing failures and post-parsing matching errors. Specifically, we quantify parsing failure rates across a range of models in Figure 2 and assess performance deltas relative to ground-truth labels in Table 1.

Model scale, family, and task type have a high impact on output formatting. Figure 2 shows that larger models tend to produce fewer formatting errors, as illustrated by the Llama-3 models on context extraction and Qwen-3 on open-form math tasks. Model family also plays a significant role: Qwen-3 and Gemma-3 consistently achieve near-perfect formatting compliance on context extraction, whereas smaller Llama-3 models exhibit substantially higher failure rates. Task type further impacts formatting accuracy. Open-form math proves the most challenging, with Llama-3 70B generating incorrectly formatted outputs over 60% of the time and Qwen-3 32B around 20%, while multiple-choice and context extraction tasks are much easier, with mid- to large-scale models often achieving near-zero failure rates.

Regex-based evaluation distorts performance measurements. Table 1 illustrates the risks of relying on regex-based evaluation, showing substantial negative deltas in measured performance across a broad set of models. Notably, even models with high formatting compliance (e.g., Gemma-3 family on context extraction tasks) suffer from substantial underestimation, often due to overly verbose outputs that technically follow formatting rules but fail lexical matching. Overall, regexbased assessment significantly distorts leaderboard rankings; for instance, Qwen-3 32B drops 18 positions while Gemma-3 4B climbs 6 on multiple-choice tasks, with these shifts often representing mere artifacts of formatting quirks and rigid lexical matching rather than true differences in capability.

Quantification of regex parsing failures.
Figure 2. Quantification of regex parsing failures. Values represent the failure rate, defined as the percentage of instances with unparsable outputs. Results are shown for the Llama-3, Gemma-3, and Qwen-3 model families and aggregated by task category.

Encoder-Based Evaluation

In this section, motivated by the observation that regex-based evaluation fails to accurately reflect true model performance across a wide range of benchmarks (section 3), we train a BERT-as-a-Judge encoder model to assess answer correctness following the methodology described in subsection 2.3. We then assess the proposed approach using the setup detailed in subsection 2.4 and report the results in Table 2. To further support our analysis, Table 3 shows performance for models whose outputs were excluded from the training mixture.

Table 1 | Impact of regex-based evaluation on measured model performance. The “Δ Accuracy” columns report the difference between regex-based and ground-truth (synthetic-label) accuracy, with values in parentheses indicating the contributions from parsing failures and post-parsing matching, respectively. The “Δ Rank” columns show the corresponding average change in ranking across the 36 evaluated models, where greener values indicate upward rank changes and redder values indicate downward rank changes.

BERT-as-a-Judge shows the strongest alignment with human judgments. As shown in Table 2, our trained encoder achieves the highest accuracy against ground-truth labels across all benchmarks. This advantage holds across task types, reaching near-perfect alignment on multiple-choice datasets (e.g., 99.7% on ARC-Easy and 98.5% on MMLU) and remaining high on complex-output tasks (98.8% on GSM8K and 93.9% on MATH). It also consistently outperforms the regex-based method by substantial margins (e.g., +21.1% on CoQA, +20.3% on MATH, +10.4% on ARC-Challenge), demonstrating that a dedicated encoder more reliably captures answer correctness than rigid lexical heuristics, while remaining computationally efficient (≈200 ms per sample on an Apple M1 CPU).

BERT-as-a-Judge is robust to out-of-domain tasks. Beyond its strong overall accuracy, the encoderbased method maintains high accuracy even on tasks excluded from the training mixture (e.g., 98.6% on TruthfulQA, 88.1% on CoQA, and 95.3% on ASDiv), highlighting its strong generalization ability across the three task categories considered (Table 2).

BERT-as-a-Judge generalizes to unseen models. Table 3 shows that removing generations from specific models in the training mixture has minimal impact on downstream assessment quality for those excluded instances. This demonstrates the strong generalization ability of our approach, indicating it can be safely extended to additional model families outside the training mixture and supporting broader adoption.

Typical encoder scales appear insufficient for LLM-as-a-Judge. Even at three times the size of our encoder, the baseline LLM judge (Qwen-3 0.6B) consistently produces the weakest results, substantially underperforming the regex baseline across all task categories (Table 2). For instance, on ARC-Challenge, it achieves only 50.2% accuracy versus 89.0% for regex, with similar gaps on Table 2 | Accuracies of evaluation methods against ground-truth labels across tasks, averaged over models. Dashed lines separate test-only tasks from those with a training split. Bold indicates the highest accuracy per task.

context extraction tasks (62.5% vs. 72.3% on SQuAD-v2). These results suggest that the evaluation capabilities of LLM-as-a-Judge do not hold for generative models under 1B parameters, highlighting the critical role of scale for such methods. We examine this limitation further in section 5.

Experimental Analysis

In this section, we further investigate the properties of our encoder-based evaluation method through a series of complementary analyses.

BERT-as-a-Judge consistently outperforms LLM-as-a-Judge across a wide range of inference budgets. As shown in Table 2, generative evaluation performs poorly at small scales (0.6B parameters). To complement these findings, we conduct a more extensive comparison by varying the judge family (Qwen-3, Gemma-3), model size (0.6B to 32B for Qwen-3 and 1B to 27B for Gemma-3), and inference budget (allowing or not intermediate chain-of-thought tokens before producing the final assessment). Figure 3 shows that our encoder matches the performance of the top-performing LLM judges in the defined setup, while remaining drastically less computationally expensive in terms of inference FLOPs.

BERT-as-a-Judge is training-efficient. By default, we train encoder models on 1M question-candidate-reference triplets. In this experiment, we evaluate lighter configurations: 500K,

200K, and 100K samples (Figure 4). Remarkably, 100K training samples are sufficient to accurately evaluate multiple-choice and open-form math tasks, with no significant improvement observed beyond this point. Gains are more noticeable for context extraction, as expected, since this task category requires more than simple candidate-reference matching and often demands understanding of the context provided by the question. Overall, with just 2 GPU hours of training (corresponding to the 100K-sample configuration), our encoder achieves a high assessment accuracy, making it well-suited for settings with limited data and computational resources.

Combining BERT-as-a-Judge with regex offers an efficient compromise. In this experiment, we use BERT-as-a-Judge as a fallback when regex parsing fails. While it does not reach the performance of the standalone encoder, this hybrid approach substantially improves over regex alone. The results demonstrate that selectively applying the encoder can recover a significant portion of assessment accuracy while keeping computational overhead low (for example, reducing total compute by a factor of five for a model with 20% regex failures).

Removing the question from the prompt yields a controlled performance decrease. As shown in Table 5, omitting the question during encoder training (leaving only the candidate and reference) reduces overall assessment accuracy by removing some contextual information. However, this decrease is well-controlled across tasks. The question-free encoder still outperforms regex and remains close to the full-prompt setup, particularly on multiple-choice and open-form math tasks, while also reducing runtime due to shorter prompts and enabling application to any task with fully textual outputs, including multimodal tasks. The performance gap is slightly larger for context extraction, where the question provides critical information, underscoring the encoder's context-aware capabilities.

Table 6 | Encoder's robustness to answer formatting. "Test Set (Form.)" denotes test sets with formatted answers, while "Test Set (Free)" contains unformatted answers. "Regex" columns show regex-based results, and "BERT-J. (Form.)" and "BERT-J. (Free)" report accuracies for BERT-as-a-Judge encoders trained on formatted and unformatted answers, respectively. Regex results are omitted for the freeformat test set, as answers cannot be reliably parsed.

BERT-as-a-Judge is robust to variations in answer formatting guidelines. In our core experiments, and to ensure a fair comparison with the regex baseline, we train and evaluate the encoder on answers formatted to facilitate lexical parsing (subsection 2.1). In practice, however, users may follow custom guidelines or allow free-form responses. Table 6 shows that under cross-formatting evaluation, meaning free-to-formatted (training on free-form, evaluating on formatted answers) and formattedto-free (the reverse), we observe a slight performance drop compared to aligned settings. Nevertheless, the encoder still substantially outperforms regex, demonstrating strong robustness to variations in answer formatting. As expected, the free-to-formatted encoder consistently outperforms the formattedto-free variant, benefiting from exposure to a wider range of formats during training and making it the preferred choice for downstream applications.

BERT-as-a-Judge is robust to decision threshold variations. Encoder classifiers output continuous sigmoid probabilities, requiring a decision threshold for discrete evaluation. While our main experiments (section 4) use a standard 0.5 threshold, Figure 5 demonstrates that accuracies remain remarkably stable across a broad spectrum of threshold values for all task categories. This invariance indicates strong separation between classes, enabling reliable off-the-shelf deployment without the need for task-specific threshold tuning.

BERT-as-a-Judge evalua-
Figure 4. BERT-as-a-Judge evalua-
Comparison between encoder-based evaluation and LLM judges from the Qwen-3 and Gemma-3 families across different model sizes and inference budgets.
Figure 3. Comparison between encoder-based evaluation and LLM judges from the Qwen-3 and Gemma-3 families across different model sizes and inference budgets. "S" ("short") denotes the default generation setup, in which the model answers directly with "True" or "False", while "L" ("long") allows the generation of intermediate chain-of-thought tokens before the final judgment.
Effect of score thresholding on BERT-as-a-Judge downstream assessment accuracy across the three task categories, averaged over all models.
Figure 5. Effect of score thresholding on BERT-as-a-Judge downstream assessment accuracy across the three task categories, averaged over all models.

Related Work

Traditional LLM evaluation. Pretrained language models have traditionally been evaluated using log-likelihood [45] or few-shot generation [46, 47, 48, 49, 50]. With the rise of instruction-tuned models, zero-shot generative evaluation has become standard [3, 51, 16, 18]. This paradigm typically enforces structured outputs via prompting [5, 6], followed by rule-based comparison to references using deterministic metrics such as exact match, ROUGE [7], Math-Verify [9], or Code-Eval [52], making evaluation highly sensitive to surface-level formatting.

Model-based evaluation. Both lexical parsing and matching introduce limitations in capturing semantic correctness and robustness. Lexical overlap does not guarantee semantic equivalence, motivating neural metrics such as BERTScore [8] and InfoLM [53] for general text generation, as well as task-specific evaluators like COMET [54, 55, 56], MetricX [57, 58], and BLEURT [59]. Additionally, reliably extracting model outputs is challenging when formatting is inconsistent [60, 61]. To mitigate these issues, LLM-as-a-Judge approaches [12, 13, 62, 63, 64] directly assess candidate-reference equivalence across tasks, offering greater robustness to formatting artifacts, albeit at a substantial computational cost.

Conclusion

In this work, we show that standard evaluation protocols often conflate a model's underlying problemsolving ability with its compliance to formatting constraints. Across extensive experiments spanning diverse models and tasks, we demonstrate that regex-based evaluation can substantially underestimate true performance. To address this, we propose BERT-as-a-Judge, a lightweight encoder-based framework that better captures semantic correctness, aligns more closely with human judgment, and avoids the high computational cost of LLM-as-a-Judge methods, enabling efficient and more reliable evaluation.

Limitations and Future Work

While BERT-as-a-Judge shows strong alignment with human judgments and effectively mitigates the limitations of lexical assessment, our study focuses on a specific subset of evaluation settings, namely, English benchmarks with objectively verifiable answers, where correctness can be clearly defined.

Building on these results and the existing literature, a natural next step is to broaden the scope of encoder-based evaluation toward more general-purpose settings. This includes expanding beyond fact-based and structured tasks to open-ended generation scenarios such as summarization, machine translation, code generation, and instruction following. Additionally, adapting the framework to multilingual contexts would further improve its applicability across diverse use cases. As foundation models continue to evolve toward multimodal capabilities, extending this approach to handle vision and speech inputs also presents a promising avenue. Exploring such cross-modal evaluation settings (e.g., visual question answering, image captioning, or speech-based reasoning) could help move toward a unified and efficient evaluation paradigm applicable across tasks and modalities.

Next step

A problem worth researching?

Tell us what you are trying to solve, and we will put you in touch with the people who work on it.