Abstract
Language models can generate plausible code that fails its tests. This thesis investigates whether internal attention patterns predict failure before generation finishes, allowing computation to shift toward more promising candidates. The student will build on the Prober repository to train and evaluate lightweight prediction models.
Supervision
- Roman Machacek
Motivation
Generating several solutions increases the chance of finding working code but consumes computation. Early failure predictions could reduce this cost, provided they do not discard too many successful candidates. Prober already supports code generation, test execution, and attention feature extraction, providing a foundation for studying this tradeoff.
Goal
The student will evaluate whether attention-based predictions improve code generation under a fixed computation budget. Expected deliverables include:
- probes that predict test success from different model layers and generation checkpoints
- comparisons with token probabilities, model-reported confidence, and code-text baselines
- an adaptive strategy that stops unlikely candidates and continues promising ones
- evaluation on held-out programming problems, measuring success rate, calibration, computational savings, and mistakenly discarded solutions
Requirements
Strong Python and machine learning skills, with experience in PyTorch. Familiarity with transformers, software testing, and basic statistics is expected; GPU computing experience is helpful.
Pointers
- M. Chen et al., “Evaluating Large Language Models Trained on Code,” 2021.
- S. Kadavath et al., “Language Models (Mostly) Know What They Know,” 2022.
- N. Jain et al., “LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code,” 2024.