public_test_potential
genlm.eval.domains.livecodebench.public_test_potential
Public-test potential and self-repair feedback. Runs the public tests on a finished generation and turns the result into a soft score plus feedback for a repair turn. prefix() does nothing, since a partial answer might still come good and we never want to kill it; complete() lowers the weight when public tests fail but never returns -inf. It only ever runs the public tests, never the private ones.
PublicTestResult
dataclass
Outcome of running a single public test.
Source code in genlm/eval/domains/livecodebench/public_test_potential.py
PublicTestFeedback
dataclass
Aggregate public-test outcome for a generation, with a repair summary.
Source code in genlm/eval/domains/livecodebench/public_test_potential.py
summary(max_cases=3, max_chars=300)
Human-readable failing-test report for a repair prompt.
Source code in genlm/eval/domains/livecodebench/public_test_potential.py
LCBPublicTestPotential
Bases: Potential
Soft public-test verifier. prefix never kills; complete returns
0.0 when all public tests pass, otherwise a finite penalty proportional to
the number of failed tests (floored at min_score, never -inf).
Source code in genlm/eval/domains/livecodebench/public_test_potential.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
run_public_tests(generation)
Run every public test on generation (a full model output; code is
extracted with the configured style) and return structured feedback.
Results are cached per extracted code.
Source code in genlm/eval/domains/livecodebench/public_test_potential.py
repair_question_content(question_content, previous_code, feedback)
Augment the original question with the failed attempt and public-test feedback, for a second (repair) generation turn.
Source code in genlm/eval/domains/livecodebench/public_test_potential.py
format_repair_prompt(tokenizer, instance, previous_generation, feedback, use_chat_format=False, style='generic')
Build the next-turn repair prompt for instance and return token ids,
matching the contract of default_prompt_formatter.