Compare holdout gains directly to the verified original LiSA baseline
This commit is contained in:
@@ -16,6 +16,26 @@ from functional.model import StreamingLM
|
||||
from functional.run import write_json
|
||||
|
||||
|
||||
def score_differences(scores):
|
||||
"""Per-question accuracy changes under each matched or original LiSA comparison."""
|
||||
shared = scores['shared-allocated']
|
||||
uniform = scores['shared-uniform']
|
||||
local = scores['local-allocated']
|
||||
prior = scores['prior-lisa']
|
||||
student = scores['trajectory-student']
|
||||
reference = scores['trajectory-reference']
|
||||
return {
|
||||
'rank-vs-uniform': shared - uniform,
|
||||
'rank-vs-prior': shared - prior,
|
||||
'rank-vs-reversed': shared - scores['shared-reversed'],
|
||||
'rank-vs-local': shared - local,
|
||||
'rank-interaction': (shared - uniform) - (local - scores['local-uniform']),
|
||||
'student-vs-prior': student - prior,
|
||||
'reference-vs-prior': reference - prior,
|
||||
'student-vs-reference': student - reference,
|
||||
}
|
||||
|
||||
|
||||
def changed_answers(questions, comparisons, local_uniform):
|
||||
"""Identify net gains that hide different sets of corrected and lost answers."""
|
||||
ids = np.array([item['id'] for item in questions]).reshape(local_uniform.shape)
|
||||
@@ -98,13 +118,7 @@ def main():
|
||||
scores[arm] = np.array([x['arms'][arm]['correct'] for x in rows],dtype=int).reshape(-1,2)
|
||||
generation[arm] = {'generated_tokens':sum(len(row['arms'][arm]['tokens']) for row in rows),
|
||||
'seconds':sum(row['batch_seconds'] for row in rows[::2])}
|
||||
comparisons = {'rank-vs-uniform':scores['shared-allocated']-scores['shared-uniform'],
|
||||
'rank-vs-reversed':scores['shared-allocated']-scores['shared-reversed'],
|
||||
'rank-vs-local':scores['shared-allocated']-scores['local-allocated'],
|
||||
'rank-interaction':scores['shared-allocated']-scores['shared-uniform']
|
||||
-scores['local-allocated']+scores['local-uniform'],
|
||||
'student-vs-prior':scores['trajectory-student']-scores['prior-lisa'],
|
||||
'student-vs-reference':scores['trajectory-student']-scores['trajectory-reference']}
|
||||
comparisons = score_differences(scores)
|
||||
rng = np.random.default_rng(72505)
|
||||
sample = rng.integers(0,len(questions)//2,size=(10000,len(questions)//2))
|
||||
audit = {'questions':len(questions),
|
||||
|
||||
Reference in New Issue
Block a user