NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

CodeSift: An LLM-Based Reference-Less Framework for Automatic Code Validation

Pooja Aggarwal, Oishik Chatterjee, Ting Dai, Prateeti Mohapatra, Brent Paulovicks, Brad Blancett, Arthur De Magalhaes

TL;DR

CodeSift is a novel, reference-less code validation framework that uses Large Language Models (LLMs) to verify the functional correctness of generated code without executing it. By translating code into natural language descriptions and performing text-to-text comparisons against the original prompt, CodeSift acts as an efficient, secure first-line filter that outperforms state-of-the-art evaluation methods.

What Problem Does This Paper Address?

As LLMs become deeply integrated into software development and IT operations (ITOps), they generate massive volumes of code. However, ensuring this code is actually correct before deploying it to production remains a massive bottleneck.

Traditional validation relies on two main approaches, both of which have severe limitations:

  1. Match- or Embedding-based methods: These require a "ground truth" reference code to compare against, which is rarely available in real-world, dynamic environments.
  2. Execution-based methods: These run the generated code against unit tests. While accurate, they require setting up secure sandboxes (running unverified code is a major security risk), do not scale well under heavy workloads, and require labor-intensive test-case generation.

The authors introduce CodeSift to bridge this gap, providing an automated validation tool that requires no code execution, no reference code, and no human feedback.

Methods

CodeSift evaluates code by shifting the problem from the complex code dimension into the natural language text dimension. The pipeline consists of two primary stages:

  1. Syntax Correctness Evaluation: CodeSift first runs the code through standard static syntax checkers (like ShellCheck for Bash or PyLint for Python). If errors are found, it feeds the error message back to the LLM to automatically repair the code.
  2. Semantic Correctness Evaluation: Once the syntax is clean, CodeSift uses an LLM to perform a three-step semantic check:
  3. Code-to-Functionality: The LLM translates the generated code into a one-line natural language description (code-func) explaining what the code actually does.
  4. Similarity Analysis: The LLM compares code-func to the original task description to see if they share the same high-level goal.
  5. Difference Analysis: In a separate prompt, the LLM is explicitly tasked with finding any subtle discrepancies or missing requirements between code-func and the task description.
  6. Ensemble Synthesis: CodeSift marks the code as correct only if the similarity analysis passes and the difference analysis finds zero disparities.
CodeSift System Diagram and Prompt Examples

Datasets

The framework was evaluated across three datasets spanning two programming languages:

  • HumanEval: A standard benchmark containing 164 Python programming problems.
  • MBPP+: A refined, rigorous subset of the Mostly Basic Python Problems dataset containing 399 problems.
  • Bash Dataset (New): A novel benchmark curated by the authors consisting of 100 unique UNIX scripting tasks complete with test cases and example ground-truth code, designed to mimic real-world system administration and incident remediation tasks.

Key Insights and Ideas

  • Text-to-Text > Text-to-Code: LLMs are significantly better at comparing two natural language descriptions than they are at directly comparing a text prompt to raw code. Translating code to text first unlocks the LLM's core semantic comprehension strengths.
  • More Information Isn't Always Better: Surprisingly, baseline methods that had access to reference code (Reference Grading) performed worse than CodeSift's reference-less approach. Because multiple distinct coding paths can achieve the same outcome, code-to-code comparisons often penalize valid, creative solutions.
  • Catching the Un-executable: CodeSift can catch negative constraints that unit tests completely miss. For example, if a prompt specifies "Do not use recursion," a recursive function might still pass all execution unit tests. CodeSift, however, successfully flags this violation during its text-based analysis.
Examples of Successful and Failed Evaluations

Key Results

The authors compared CodeSift against two prominent LLM-based evaluation baselines: ICE-Score (direct prompt-to-code evaluation) and Reference Grading (LLM-as-a-judge with reference code).

  • Higher Accuracy: When using Mistral-7B or Mixtral-8x7B as the evaluation backbone, CodeSift consistently outperformed the baselines across all datasets. For instance, on HumanEval code generated by StarCoder, CodeSift achieved 72.92% accuracy compared to ICE-Score's 64.6%.
  • Human Alignment: A user study conducted with three Subject Matter Experts (SMEs) evaluating 105 Bash script instances showed that experts agreed with CodeSift’s functionality descriptions 78% of the time and agreed with its final validation verdicts 83% of the time.
Accuracy of Various LLM-Based Code Evaluation Methods

Limitations and Future Work

CodeSift's primary vulnerability is its dependency on the initial Code-to-Functionality step. If the LLM fails to accurately summarize what the code does, the subsequent similarity and difference analyses will inherit that error, leading to false positives or negatives. Additionally, LLM evaluations can be verbose, making automated parsing tricky at times.

For future work, the authors intend to expand CodeSift to support a broader range of programming languages, improve the interpretability of the framework's decision-making process, and feed CodeSift's natural language critiques directly back into code generation models to iteratively improve code quality.

Summary updated

BibTeX
@inproceedings{aggarwal2024codesift,
  author = {Pooja Aggarwal and Oishik Chatterjee and Ting Dai and Prateeti Mohapatra and Brent Paulovicks and Brad Blancett and Arthur De Magalhaes},
  title = {{CodeSift: An LLM-Based Reference-Less Framework for Automatic Code Validation}},
  booktitle = {CLOUD},
  year = {2024},
  doi = {10.1109/cloud62652.2024.00052},
}
Figure