The Problem with LLM-as-a-Judge
Using LLMs to evaluate other models has become the industry standard, but it is fundamentally limited by high API costs, significant latency, and the 'black box' nature of LLM decisions. These factors make large-scale evaluation expensive and difficult to audit, as there is no clear logic behind why a specific score was assigned to a candidate output.
Program Distillation: From Prompts to Code
The authors propose 'program distillation' as a solution: extracting the decision-making logic of an LLM judge into a committee of executable programs. By converting an LLM's evaluation criteria into code, the system gains several advantages:
- Transparency: Programmatic judges are inherently inspectable and editable.
- Efficiency: They eliminate per-sample API costs, allowing for massive scaling of evaluation tasks.
- Performance: Across five datasets and four model families, these programmatic judges matched the performance of a 13B-parameter LLM judge.
The PAJAMA System
The authors introduce PAJAMA, a framework that manages this programmatic evaluation process. It functions through three core mechanisms:
- Synthesis: It synthesizes a committee of programs to act as judges.
- Aggregation: It combines the outputs of these programs into a single, joint verdict.
- Selective Escalation: It includes a fallback mechanism that routes low-confidence cases to an LLM, ensuring that the system maintains high accuracy while keeping the majority of traffic on the cheaper, faster programmatic path.
Beyond Evaluation: Reward Signals
Beyond simple evaluation, the authors demonstrate that these programmatic judges can generate high-quality, low-cost reward signals for training other models. On the RewardBench benchmark, a reward model trained on labels generated by these programs outperformed one trained on proprietary LLM labels, while operating at two orders of magnitude lower API cost.