TL;DR
Large Language Models (LLMs) are increasingly used to evaluate code, but they often miss critical, domain-specific errors. This paper introduces a method using "analytic hints" derived from expert analysis to guide LLM judges, significantly improving their accuracy and reliability in evaluating legacy COBOL code.
What Problem Does This Paper Address?
As AI systems generate more code, we need robust ways to evaluate its correctness, safety, and suitability for real-world applications. LLMs are attractive for this "LLM-as-a-Judge" role due to their scalability, but they struggle with tasks requiring deep domain knowledge. This is particularly true for older, specialized languages like COBOL, which have unique control flows and business logic that LLMs might not fully grasp. Even LLMs fine-tuned for code evaluation can exhibit "blind spots," consistently missing certain types of errors. This paper tackles the challenge of improving the depth and reliability of LLM-based code evaluation, especially in complex, domain-specific scenarios.
Methods
The core innovation is the "analytic hint injection" approach. The researchers first identified common LLM evaluation failures in COBOL code generation by having human experts analyze the LLM judges' outputs. This analysis led to a taxonomy of over 30 domain-specific "blind spots." Based on this taxonomy, they developed a lightweight "analytic checker" tool that scans generated COBOL code for these specific issues. When the checker finds an issue, it generates a concise "analytic hint." These hints are then dynamically injected into the LLM judge's prompt, guiding its attention to areas it might otherwise overlook. This process aims to improve evaluation depth without retraining the LLM judge itself.
Datasets
The paper introduces a new dataset consisting of 100 synthetic COBOL programs. These programs were deliberately generated to contain realistic, domain-specific errors, and their correctness was validated by human experts. This dataset was used for evaluating the proposed analytic hint injection method.
Key Insights and Ideas
- LLMs have "blind spots" in domain-specific evaluation: Even production-ready LLM judges miss consistent types of errors in specialized domains like COBOL, highlighting a fundamental limitation beyond simple prompt tuning.
- Domain expertise is crucial for identifying evaluation gaps: Human experts are essential for uncovering the subtle, domain-specific issues that LLMs overlook.
- Analytic hints can dynamically guide LLM judges: Injecting targeted hints into the LLM's prompt can effectively steer its reasoning towards previously missed errors, improving evaluation accuracy without model retraining.
- Hybrid LLM-analytic approaches offer a promising path: Combining the scalability of LLMs with the precision of rule-based analytic tools can create more reliable evaluation systems.
- Issue rediscovery rate as a metric: The percentage of errors a hint-augmented judge can still find that were originally identified by the native judge can serve as a useful metric for assessing evaluator stability and the impact of hint injection.
Key Results
Experiments were conducted using four production-level LLM judges on the custom COBOL dataset.
- Native LLM judges alone detected only 45-63% of errors.
- The analytic checker alone, while identifying issues, lacked the explanatory depth of an LLM.
- When combined, the LLM + analytic hints configuration achieved up to 74.1% error coverage (for the best-performing judge and prompt).
- The hybrid approach produced qualitatively richer and more accurate explanations.
- The optimized hint injection strategy consistently improved performance across all tested models.
- The hint-augmented judges retained a significant portion of their original evaluative capabilities, rediscovering 45-70% of the issues identified by their native counterparts.
Limitations and Future Work
The authors acknowledge that while hint injection improves targeted diagnostic precision, it might also narrow overall coverage if not carefully balanced. The study was limited to one specific task (COBOL code generation) and a relatively small dataset. Future work could explore tuning the phrasing, formatting, and placement of hints to unlock further gains. Investigating the issue-rediscovery rate as a diagnostic metric for evaluator reliability is also suggested. The authors believe this work offers a foundation for developing more robust and reliable LLM-based evaluation systems by integrating structured analytic tools.
Summary updated