Evaluating Large Language Models for Theoretical Computer Science: A Verifiability-First Benchmark Design

    This article explains how to build large language model benchmarks for theoretical computer science (TCS), where results can be machine-verified. It covers why rising leaderboard scores still fail to indicate research ability, how a verifiability-first grading pipeline shifts evaluation from wording to conclusions, how to construct a layered, full-domain question bank, and which anti-contamination measures keep scores trustworthy. It also outlines the engineering capabilities needed for a reproducible evaluation platform and three common misreadings of benchmark results. Readers will learn a practical framework for measuring whether a model can abstract, construct, and prove like a researcher.

    1. Background: Rising Scores Still Say Little About Research Ability

    Over the past two years, the capability curve of large language models has been lifting roughly every two months, and leaderboards keep multiplying. But a leaderboard score ultimately tells you only one thing: the model can solve problems within a fixed distribution of question types. It cannot answer a more important question—whether the model possesses abstraction, construction, and proof abilities close to those of a researcher.

    The more you make evaluation problems resemble real research, the harder scoring becomes. Research-style tasks typically have three characteristics:

    1. There is no single answer; multiple correct paths exist.
    2. Intermediate steps are creative and hard to match against a fixed template.
    3. Conclusions come in varied forms, so natural-language comparison is prone to misjudgment.

    Theoretical computer science (TCS) is a notable exception. Most of its conclusions can be verified by a machine: the correctness of an algorithm can be formally proved, a complexity lower bound can be checked step by step, and a construction can be run through a program. This makes it possible, for the first time, to write problems that resemble research and to grade them automatically.

    2. Core Design Principle: Verifiability First

    Traditional evaluation relies on reference answers and text-similarity matching, which essentially compares how something is written rather than what it concludes. A verifiability-first approach moves the grading target from the phrasing to the conclusion itself.

    • What is judged: whether the conclusion holds, not whether the wording is close to a reference answer.
    • How it is judged: formal proof checking, counterexample search, programmatic verification, and derivation of complexity relationships.
    • What the result looks like: binary or graded scores, reducing the variance introduced by subjective grading.

    A schematic grading flow can be abstracted as:

    1. def grade(answer, task):
    2. # 1. Structure parsing: extract conclusions, constructions, and proof steps
    3. parsed = parse(answer)
    4. # 2. Formalization: transcribe into a checkable intermediate representation
    5. formal = to_formal(parsed)
    6. # 3. Automated verification: proof checking / counterexample search / program execution
    7. ok, evidence = verify(formal, task.verifier)
    8. # 4. Anti-cheating check: whether it merely restates the prompt or hits a memorized item
    9. if is_memorized(answer, task):
    10. return {"score": 0, "reason": "contamination"}
    11. return {"score": 1 if ok else 0, "evidence": evidence}

    The value of this pipeline is that grading logic is decoupled from problem-setting logic, so the evaluation set can keep expanding without a matching increase in manual review cost.

    3. Building a Layered Question Bank That Covers the Whole Field

    A benchmark that covers only a few popular directions is easy to optimize against. A more robust approach is to layer questions by disciplinary capability dimension, forming a matrix-style question bank.

    • Complexity theory: class hierarchy relationships, reductions, and matching lower and upper bounds.
    • Algorithms and data structures: correctness proofs, worst-case and amortized complexity, and optimality arguments.
    • Computational geometry and combinatorial optimization: constructive proofs and approximation-ratio analysis.
    • Cryptography: reduction-based security proofs and indistinguishability arguments.
    • Quantum computing: gate-circuit equivalence and entanglement and measurement structure analysis.
    • Logic and automated reasoning: satisfiability and type-system properties.

    Each dimension is further split into three difficulty tiers: reproducing known results, transferring across conditions, and exploring open sub-problems. The point of layering is to make scores interpretable—whether an overall increase comes from memorized reproduction or from transfer and construction.

    4. Anti-Contamination: The Prerequisite for Trustworthy Scores

    The most common reason a benchmark fails is not that the model got weaker, but that the questions leaked into the training corpus. Practical safeguards include:

    1. Problem synthesis: generate isomorphic but superficially different variants from parameterized templates, controlling the distribution of how prompts are phrased.
    2. Private held-out set: keep a portion of questions permanently unpublished, used only for final verification.
    3. Time-based splitting: favor recently introduced results to lower the probability of memorization.
    4. Perturbation equivalence: apply symbol substitution, variable renaming, and condition reordering to the same problem, and check answer stability.
    5. Memorization probing: present an incomplete prompt first and observe whether the model “completes” the original text, identifying answer-recall behavior.

    In engineering terms, these rules can be fixed into a question-bank admission pipeline, so that every new question automatically passes contamination detection and difficulty calibration before entering the bank.

    5. Engineering Implementation: The Shape of a Reproducible Evaluation Platform

    Turning evaluation into sustainable infrastructure usually requires several general capabilities working together:

    • Object storage: hosting the question bank, grading scripts, and historical results, ensuring version traceability.
    • Container platform: providing isolated execution environments for untrusted code, with resource and network limits.
    • Message queue: smoothing peaks and filling troughs to support large batches of concurrent grading tasks.
    • Logging and monitoring with alerting: recording the input and output of every grading run, and triggering alerts when the anomaly rate exceeds a threshold.
    • Elastic compute: scaling on demand to control cost fluctuations in large-scale evaluation.

    If such a platform is built on Baidu AI Cloud, it can combine the general product categories above, using a unified metadata specification to fix a triple of question version, grader version, and model version, so that any score can be fully reproduced.

    6. Interpreting Results: Three Common Misreadings

    • Misreading one: a high overall score equals strong research ability. You should look at the layered scores, especially the transfer and construction tiers.
    • Misreading two: one evaluation run is enough to draw a conclusion. Models are sensitive to prompt wording, so you need multiple templates and multiple samples to obtain a distribution.
    • Misreading three: verifiable equals absolutely objective. The verifier itself may have coverage blind spots, so it needs periodic regression testing with known counterexamples.

    When reporting results, it is recommended to provide the layered scores, the variance interval, the contamination-detection conclusion, and the verifier coverage rate at the same time. Missing any one of them significantly reduces the explanatory power of the score.

    7. Conclusion

    Only when a discipline’s conclusions can be verified by a machine does evaluation truly move from comparing phrasing to comparing conclusions. With verifiability as the axis, together with a layered question bank, anti-contamination mechanisms, and a reproducible engineering pipeline, scores can regain explanatory power, and the answer to the question of whether a model can do research gradually becomes measurable, comparable, and trackable.