Compare commits
40 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 04a58682de | |||
| 80f79f7d15 | |||
| 41895ae357 | |||
| 3aabe061f1 | |||
| a5978c0840 | |||
| 6baff1af4a | |||
| 63b0705353 | |||
| df601404c4 | |||
| ed39e705ab | |||
| ca686a2dda | |||
| cd307640cc | |||
| af2580af21 | |||
| b0ac446450 | |||
| 398b97a1df | |||
| ce4c0e404b | |||
| c577bb740a | |||
| 8ae5e8c2f7 | |||
| 23386797c4 | |||
| 1f3ee3cbff | |||
| d1e87446d3 | |||
| e7a7015b55 | |||
| 6aa66b29a1 | |||
| 4e66b5d5ba | |||
| 4291cc207f | |||
| 2d1d28c331 | |||
| 0f4c0a982c | |||
| c53d78b4aa | |||
| 453b2ff787 | |||
| 38545d4217 | |||
| 78f3869060 | |||
| c2aa23f32f | |||
| 59072884ff | |||
| 1c8943a2e8 | |||
| 115e440455 | |||
| 67327d62d8 | |||
| 0df3b0bfe6 | |||
| f769de90c6 | |||
| 5dd3ab32c8 | |||
| 31a257ba17 | |||
| ea9bfd2a23 |
@@ -40,3 +40,107 @@ All weights and caches stay on the server until explicit user deletion. Git cont
|
||||
all figure tables and the selected small probability matrices; large caches have exact
|
||||
paths/sizes/hashes in `external-caches.json`. Old validation texts were used in earlier
|
||||
experiments; the four fresh texts were fixed before the new cross-layer measurements.
|
||||
|
||||
## LiSA-style single-layer pilot
|
||||
|
||||
The pilot reuses layer 19's actual pre-softmax scores at layer 23, with the
|
||||
recipient's own values, output gate and output projection. It compares native
|
||||
attention, direct reuse, a frozen one-to-one head assignment, linear mixing
|
||||
of donor heads, a 32-coordinate recipient-only control, and joint donor/recipient
|
||||
mixing. The linear variants use a closed-form ridge fit to the native scores,
|
||||
centred within each causal key row. The recipient branch takes a fixed subset of
|
||||
post-RoPE coordinates rather than learning a low-rank Q/K projection. The
|
||||
calibration uses 12 synthetic prompts without answer labels. All checkpoint
|
||||
weights are frozen.
|
||||
|
||||
Evaluation scores the four candidate option tokens on 24 disjoint retrieval
|
||||
prompts, including 12 with more table entries than calibration. Choice NLL
|
||||
normalizes over those four tokens. Run against the retained checkpoint on the
|
||||
remote CPU environment:
|
||||
|
||||
```sh
|
||||
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 venv/bin/python -B -m crossqkv.lisa_pilot \
|
||||
--source runs/cpu-qwen35-2b --out runs/NEW_LISA_DIRECTORY
|
||||
```
|
||||
|
||||
The diagnostic forward still computes native full Q/K and does not measure
|
||||
latency or parameter savings. Refer to LiSA (arXiv:2408.01890, §5.1) for its
|
||||
learned nonlinear head aligner and learned low-rank Q/K projections.
|
||||
|
||||
## Forward-only calibration and search
|
||||
|
||||
This follow-up keeps the final-layer intervention at 19→23 and changes the
|
||||
task to generating the latest value of a key. Some prompts contain two
|
||||
conflicting records for that key. The fit, validation and test splits contain
|
||||
12, 8 and 16 prompts, respectively. The test set adds longer lists. All
|
||||
checkpoints and grid settings are selected using validation loss before test
|
||||
replay. Each prompt's final-query scores, values, gate and residual are captured
|
||||
from a single native forward. Substitutions replay only the final query of the
|
||||
last layer and check the native replay against full-prefix activations.
|
||||
|
||||
The conditions cover direct sharing, a closed-form linear layer over the donor
|
||||
heads, a linear layer with a small current-layer Q/K branch, a two-coefficient
|
||||
diagonal grid, and two forward-only optimizers. The latter each start at
|
||||
direct sharing and run three fixed seeds. One proposes additive Gaussian
|
||||
perturbations and keeps improvements. The other proposes a bounded update
|
||||
from a two-sided directional estimate and applies the same acceptance rule.
|
||||
These methods fit only the small adapter. The backbone is frozen, and there
|
||||
is no autograd. Search traces expose forward-call budgets and selected steps.
|
||||
|
||||
From the confirmed remote workspace containing the code and retained weights:
|
||||
|
||||
```sh
|
||||
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 venv/bin/python -B -m crossqkv.forward_search capture \
|
||||
--source runs/cpu-qwen35-2b --out runs/NEW_SEARCH_CACHE
|
||||
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 venv/bin/python -B -m crossqkv.forward_search_fit \
|
||||
--source runs/cpu-qwen35-2b --cache runs/NEW_SEARCH_CACHE --out runs/NEW_SEARCH_EVAL
|
||||
```
|
||||
|
||||
The main optimization metric is nine-digit NLL. Evaluation also reports
|
||||
full-vocabulary greedy exact digit at the first answer token, and strata by
|
||||
list length and duplicate key. Each perturbation reuses fixed lower-layer
|
||||
activations, so its forward objective computes the exact affected final query
|
||||
without repeatedly forwarding the whole backbone. For interrupted captures,
|
||||
`--resume` checks source and code fingerprints and keeps finished batches.
|
||||
This is a single-site
|
||||
comparison, not an evaluation of full-model fine-tuning or measured speedup.
|
||||
|
||||
## LiSA with the published trainable modules and loss
|
||||
|
||||
`lisa_train.py` implements the two-layer 256-unit ReLU head fusion and
|
||||
learned low-rank grouped Q/K branch. The objective is the published
|
||||
0.25 Huber (delta 1) attention-score distillation plus 0.75 next-token
|
||||
full-vocabulary cross-entropy. The loss and gradient stream the frozen
|
||||
vocabulary head in chunks. This avoids allocating the whole embedding
|
||||
matrix or retaining dense vocabulary logits across backward.
|
||||
|
||||
The Qwen-specific run shares scores from layer 19 at layer 23, using
|
||||
zero-based numbering. The recipient's V, output gate, projection, MLP
|
||||
and final norm are preserved and frozen. The low-rank branch uses
|
||||
40 coordinates per head and Qwen text-mode partial RoPE. Earlier layers
|
||||
are frozen, and only the final layer is replaced, so training on cached
|
||||
recipient inputs evaluates the same next-token objective as rerunning
|
||||
the frozen prefix. The teacher path computes native scores and checks
|
||||
final hidden states against the original model. The comparison includes
|
||||
native, direct sharing, and the previous joint linear mapping.
|
||||
|
||||
The dataset is the fixed 36-prompt retrieval study with each gold digit
|
||||
appended as a next-token target. Training uses every valid shifted token
|
||||
of the fit sequences, and early model selection uses the validation
|
||||
objective before the test set. The evaluation also measures exact greedy
|
||||
digit at the answer position. This is a single-recipient port of the method.
|
||||
The paper's LLaMA configurations, RedPajama training budget, and 13-task
|
||||
results are separate experimental conditions.
|
||||
|
||||
```sh
|
||||
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 venv/bin/python -B -m crossqkv.lisa_reproduction capture \
|
||||
--source runs/cpu-qwen35-2b --out runs/NEW_LISA_FULL_CACHE
|
||||
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 venv/bin/python -B -m crossqkv.lisa_reproduction train \
|
||||
--source runs/cpu-qwen35-2b --cache runs/NEW_LISA_FULL_CACHE --out runs/NEW_LISA_FULL_RESULT \
|
||||
--linear-control results/lisa-forward-search/frozen.json
|
||||
```
|
||||
|
||||
References: [paper §5 and Appendix C](https://arxiv.org/html/2408.01890v2) and
|
||||
[authors' implementation](https://github.com/takagi97/lisa). The official
|
||||
code names its distillation weight `mse_loss_weight` but computes Huber,
|
||||
consistent with the paper.
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
"""Forward-only attention sharing experiments on one frozen Qwen checkpoint."""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
import random
|
||||
|
||||
import numpy as np
|
||||
from tokenizers import Tokenizer
|
||||
|
||||
from crossqkv.lisa_pilot import DONOR, TARGET, Study
|
||||
from functional.run import write_json
|
||||
|
||||
SEEDS = {'fit': 22301, 'validation': 22302, 'test': 22303}
|
||||
|
||||
|
||||
def problems(split):
|
||||
rng = random.Random(SEEDS[split])
|
||||
n = {'fit': 12, 'validation': 8, 'test': 16}[split]
|
||||
words = 'ash elm oak fir yew pine birch cedar maple reed moss fern'.split()
|
||||
examples = []
|
||||
for i in range(n):
|
||||
count = 10 if split == 'test' and i % 4 >= 2 else 6
|
||||
keys = rng.sample(words, count)
|
||||
first = rng.randrange(count - 1) if i % 2 else rng.randrange(count)
|
||||
key = keys[first]
|
||||
values = [rng.randrange(1, 10) for _ in keys]
|
||||
if i % 2:
|
||||
overwritten = rng.randrange(first + 1, count)
|
||||
keys[overwritten] = key
|
||||
values[overwritten] = (values[first] - 1 + rng.randrange(1, 9)) % 9 + 1
|
||||
last = max(j for j, k in enumerate(keys) if k == key)
|
||||
entries = ', '.join(f'{k}={v}' for k, v in zip(keys, values))
|
||||
prompt = f'Records (oldest first): {entries}. What is the latest value of {key}? Answer with one digit:'
|
||||
examples.append({'prompt': prompt, 'gold': values[last], 'entries': count,
|
||||
'duplicate': bool(i % 2), 'id': f'{split}-{i:02}'})
|
||||
return examples
|
||||
|
||||
|
||||
def encode(tok, examples):
|
||||
prompts, labels = [], None
|
||||
for ex in examples:
|
||||
rows = [tok.encode(f"{ex['prompt']} {i}", add_special_tokens=False).ids
|
||||
for i in range(1, 10)]
|
||||
prefix = rows[0][:-1]
|
||||
digits = [row[-1] for row in rows]
|
||||
if any(row[:-1] != prefix for row in rows) or len(set(digits)) != 9:
|
||||
raise ValueError('Digit answers must share a prefix and differ by one token')
|
||||
if labels is not None and digits != labels:
|
||||
raise ValueError('Digit tokens differ between prompts')
|
||||
prompts.append(prefix)
|
||||
labels = digits
|
||||
lengths = np.array([len(row) for row in prompts])
|
||||
padded = [row + [0] * (max(lengths) - len(row)) for row in prompts]
|
||||
return np.array(padded, dtype=np.int64), lengths, labels
|
||||
|
||||
|
||||
def collect(source, out, resume=False):
|
||||
cfg = json.loads((source / 'model_config.json').read_text())
|
||||
lm = Study(source / 'weights', cfg, seconds=3600)
|
||||
assert TARGET == len(lm.config['layer_types']) - 1
|
||||
lm.capture_scores = True
|
||||
tok = Tokenizer.from_file(str(source / 'tokenizer.json'))
|
||||
rows = {s: problems(s) for s in SEEDS}
|
||||
assert len({q['prompt'] for qs in rows.values() for q in qs}) == 36
|
||||
protocol = {
|
||||
'donor': DONOR, 'recipient': TARGET, 'seeds': SEEDS,
|
||||
'capture_code_sha256': hashlib.sha256(Path(__file__).read_bytes()).hexdigest(),
|
||||
'source_files_sha256': {name: hashlib.sha256((source / name).read_bytes()).hexdigest()
|
||||
for name in ('manifest.json', 'model_config.json', 'tokenizer.json')},
|
||||
}
|
||||
for name, content in [('protocol.json', protocol), ('problems.json', rows)]:
|
||||
path = out / name
|
||||
if resume and path.exists():
|
||||
if json.loads(path.read_text()) != content:
|
||||
raise ValueError(f'Existing capture uses different inputs: {path}')
|
||||
else:
|
||||
write_json(path, content)
|
||||
for split, examples in rows.items():
|
||||
for start in range(0, len(examples), 4):
|
||||
group = examples[start:start+4]
|
||||
ids, lengths, labels = encode(tok, group)
|
||||
path = out / f'{split}-{start:02}.npz'
|
||||
if resume and path.is_file():
|
||||
with np.load(path, allow_pickle=False) as previous:
|
||||
if (previous['ids'].tolist() != [ex['id'] for ex in group] or
|
||||
not np.array_equal(previous['lengths'], lengths) or
|
||||
not np.array_equal(previous['labels'], labels)):
|
||||
raise ValueError(f'Existing cache batch differs: {path}')
|
||||
print(f'{split}: reused {start + len(group)}/{len(examples)} prompts', flush=True)
|
||||
continue
|
||||
hidden, _ = lm.forward(ids)
|
||||
row = np.arange(len(group))
|
||||
at = lengths - 1
|
||||
recipient = lm.recipient
|
||||
pending = path.with_suffix('.tmp.npz')
|
||||
np.savez(pending, ids=[ex['id'] for ex in group],
|
||||
donor=lm.donor[row, :, at], teacher=lm.teacher[row, :, at],
|
||||
local=lm.local[row, :, at], values=recipient['v'],
|
||||
gate=recipient['gate'][row, at], residual=lm.recipient_input[row, at],
|
||||
hidden=hidden[row, at], lengths=lengths, labels=labels,
|
||||
gold=[ex['gold']-1 for ex in group])
|
||||
pending.replace(path)
|
||||
print(f'{split}: captured {start + len(group)}/{len(examples)} prompts', flush=True)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('phase', choices=('capture',))
|
||||
parser.add_argument('--source', required=True, type=Path)
|
||||
parser.add_argument('--out', required=True, type=Path)
|
||||
parser.add_argument('--resume', action='store_true')
|
||||
args = parser.parse_args()
|
||||
args.out.mkdir(exist_ok=args.resume)
|
||||
collect(args.source, args.out, resume=args.resume)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,249 @@
|
||||
"""Fit lightweight attention adapters and compare them on held-out prompts."""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
|
||||
from crossqkv.lisa_pilot import TARGET, solve
|
||||
from functional.model import PREFIX, norm, sigmoid, silu
|
||||
from functional.run import write_json
|
||||
from pilot.tensors import decode, load_tensors
|
||||
|
||||
SPLITS = {'fit': 12, 'validation': 8, 'test': 16}
|
||||
SEARCH_SEEDS = (1701, 1702, 1703)
|
||||
SEARCH_STEPS = 24
|
||||
|
||||
|
||||
def load_split(root, name):
|
||||
paths = sorted(root.glob(f'{name}-*.npz'))
|
||||
if len(paths) * 4 != SPLITS[name]:
|
||||
raise ValueError(f'Incomplete capture for {name}')
|
||||
records = []
|
||||
for path in paths:
|
||||
with np.load(path, allow_pickle=False) as data:
|
||||
records.append(dict(data))
|
||||
if any(not np.array_equal(x['labels'], records[0]['labels']) for x in records):
|
||||
raise ValueError('Digit token mismatch')
|
||||
out = {'labels': records[0]['labels']}
|
||||
for k in records[0].keys() - {'labels'}:
|
||||
arrays = [r[k] for r in records]
|
||||
if k in ('donor', 'teacher', 'local', 'values'):
|
||||
axis = 1 if k == 'values' else 2
|
||||
width = max(a.shape[axis] for a in arrays)
|
||||
padded = []
|
||||
for a in arrays:
|
||||
pad = [(0, 0)] * a.ndim
|
||||
pad[axis] = (0, width - a.shape[axis])
|
||||
padded.append(np.pad(a, pad))
|
||||
arrays = padded
|
||||
out[k] = np.concatenate(arrays, axis=0)
|
||||
return out
|
||||
|
||||
|
||||
class LastLayer:
|
||||
def __init__(self, source):
|
||||
cfg = json.loads((source / 'model_config.json').read_text())['text_config']
|
||||
self.eps = cfg['rms_norm_eps']
|
||||
self.repeats = cfg['num_attention_heads'] // cfg['num_key_value_heads']
|
||||
self.tensors = load_tensors(source / 'weights')
|
||||
layer = f'layers.{TARGET}.'
|
||||
names = {
|
||||
'o': layer + 'self_attn.o_proj', 'gate': layer + 'mlp.gate_proj',
|
||||
'up': layer + 'mlp.up_proj', 'down': layer + 'mlp.down_proj',
|
||||
'post': layer + 'post_attention_layernorm', 'final': 'norm',
|
||||
}
|
||||
self.weights = {}
|
||||
for key, name in names.items():
|
||||
t = self.tensors[PREFIX + name + '.weight']
|
||||
self.weights[key] = t.read().reshape(t.shape)
|
||||
t.evict()
|
||||
self.embedding = self.tensors[PREFIX + 'embed_tokens.weight']
|
||||
|
||||
def digits(self, labels):
|
||||
t = self.embedding
|
||||
out = decode(t.raw.reshape(t.shape)[labels], t.dtype)
|
||||
t.evict()
|
||||
return out
|
||||
|
||||
def forward(self, batch, scores):
|
||||
keys = np.arange(scores.shape[-1]) < batch['lengths'][:, None]
|
||||
x = np.where(keys[:, None, :], scores, -np.inf)
|
||||
p = np.exp(x - x.max(axis=-1, keepdims=True))
|
||||
p /= p.sum(axis=-1, keepdims=True)
|
||||
v = np.repeat(batch['values'], self.repeats, axis=2)
|
||||
context = np.einsum('bhs,bshd->bhd', p, v)
|
||||
gated = (context * sigmoid(batch['gate'])).reshape(len(scores), -1)
|
||||
w = self.weights
|
||||
h = batch['residual'] + gated @ w['o'].T
|
||||
n = norm(h, w['post'], self.eps)
|
||||
return norm(h + (silu(n @ w['gate'].T) * (n @ w['up'].T)) @ w['down'].T,
|
||||
w['final'], self.eps)
|
||||
|
||||
def greedy(self, states):
|
||||
t = self.embedding
|
||||
best = np.full(len(states), -np.inf)
|
||||
tokens = np.zeros(len(states), dtype=int)
|
||||
cols = np.arange(len(states))
|
||||
for start in range(0, t.shape[0], 1024):
|
||||
end = min(start + 1024, t.shape[0])
|
||||
w = t.read(slice(start*t.shape[1], end*t.shape[1])).reshape(end-start, -1)
|
||||
logits = states @ w.T
|
||||
local = logits.argmax(axis=1)
|
||||
values = logits[cols, local]
|
||||
better = values > best
|
||||
tokens[better] = start + local[better]
|
||||
best[better] = values[better]
|
||||
t.evict()
|
||||
return tokens
|
||||
|
||||
|
||||
def features(batch):
|
||||
return np.concatenate((batch['donor'], batch['local']), axis=1)
|
||||
|
||||
|
||||
def transform(batch, weights):
|
||||
return np.einsum('bhs,hi->bis', features(batch), weights)
|
||||
|
||||
|
||||
def centered(rows, lengths):
|
||||
return np.concatenate([(x[:, :n] - x[:, :n].mean(axis=1, keepdims=True)).T
|
||||
for x, n in zip(rows, lengths)]).astype(np.float64)
|
||||
|
||||
|
||||
def digit_losses(logits, gold):
|
||||
return np.logaddexp.reduce(logits.astype(np.float64), axis=1) - logits[np.arange(len(gold)), gold]
|
||||
|
||||
|
||||
def candidate_loss(model, batch, weights):
|
||||
h = model.forward(batch, transform(batch, weights))
|
||||
return float(digit_losses(h @ model.digits(batch['labels']).T, batch['gold']).mean())
|
||||
|
||||
|
||||
def random_search(loss, validation, start, seed, method):
|
||||
rng = np.random.default_rng(seed)
|
||||
current = start.copy()
|
||||
current_loss = loss(current)
|
||||
checkpoints = [(validation(current), 0, current.copy())]
|
||||
trace = []
|
||||
for step in range(SEARCH_STEPS):
|
||||
noise = rng.standard_normal(current.shape, dtype=np.float32)
|
||||
radius = .10 * .5 ** (step // 8)
|
||||
if method == 'hill':
|
||||
proposal = current + radius * noise
|
||||
trial = loss(proposal)
|
||||
accepted = trial < current_loss
|
||||
else:
|
||||
plus = loss(current + .025 * noise)
|
||||
minus = loss(current - .025 * noise)
|
||||
# Bounded two-sided directional update. Clip the RMS step per coordinate.
|
||||
scale = float(np.clip(.03 * (plus - minus) / .05, -radius, radius))
|
||||
proposal = current - scale * noise
|
||||
trial = loss(proposal)
|
||||
accepted = trial < current_loss
|
||||
if accepted:
|
||||
current, current_loss = proposal, trial
|
||||
rec = {'step': step + 1, 'proposal_loss': trial,
|
||||
'accepted': bool(accepted), 'incumbent_loss': current_loss}
|
||||
if method != 'hill':
|
||||
rec.update(plus_loss=plus, minus_loss=minus)
|
||||
trace.append(rec)
|
||||
if (step + 1) % 6 == 0:
|
||||
checkpoints.append((validation(current), step + 1, current.copy()))
|
||||
val, step, chosen = min(checkpoints, key=lambda item: (item[0], item[1]))
|
||||
return chosen, {'seed': seed, 'selected_step': step, 'validation_loss': val,
|
||||
'checkpoints': [{'step': s, 'loss': l} for l, s, _ in checkpoints],
|
||||
'fit_forward_evaluations': 1 + SEARCH_STEPS * (1 if method == 'hill' else 3),
|
||||
'trace': trace}
|
||||
|
||||
|
||||
def run(source, cache, out):
|
||||
protocol = json.loads((cache / 'protocol.json').read_text())
|
||||
for name, sha in protocol['source_files_sha256'].items():
|
||||
if hashlib.sha256((source / name).read_bytes()).hexdigest() != sha:
|
||||
raise ValueError(f'Source provenance mismatch: {name}')
|
||||
problems = json.loads((cache / 'problems.json').read_text())
|
||||
model = LastLayer(source)
|
||||
fit, validation = (load_split(cache, split) for split in ('fit', 'validation'))
|
||||
for split, batch in [('fit', fit), ('validation', validation)]:
|
||||
if batch['ids'].tolist() != [ex['id'] for ex in problems[split]]:
|
||||
raise ValueError(f'Capture order differs for {split}')
|
||||
heads = fit['donor'].shape[1]
|
||||
eye = np.eye(heads, dtype=np.float32)
|
||||
direct = np.concatenate((eye, np.zeros_like(eye)))
|
||||
q = centered(features(fit), fit['lengths'])
|
||||
y = centered(fit['teacher'], fit['lengths'])
|
||||
linear = np.concatenate((solve(q[:, :heads], y), np.zeros_like(eye)))
|
||||
weights = {'direct': direct, 'linear_donor': linear, 'linear_joint': solve(q, y)}
|
||||
fit_loss = lambda w: candidate_loss(model, fit, w)
|
||||
val_loss = lambda w: candidate_loss(model, validation, w)
|
||||
grid = [(a, b, np.concatenate((a*eye, b*eye)))
|
||||
for a in (.5, 1., 1.5) for b in (0., .25, .5, 1.)]
|
||||
grid_scores = [(val_loss(w), a, b, w) for a, b, w in grid]
|
||||
_, gain, local, weights['diagonal_grid'] = min(grid_scores, key=lambda r: r[0])
|
||||
optimization = {'grid': [{'donor_gain': a, 'local_gain': b, 'loss': l}
|
||||
for l, a, b, _ in grid_scores],
|
||||
'selected_gains': [gain, local], 'searches': {}}
|
||||
for method in ('hill', 'two_sided'):
|
||||
for seed in SEARCH_SEEDS:
|
||||
key = f'{method}_{seed}'
|
||||
weights[key], optimization['searches'][key] = random_search(
|
||||
fit_loss, val_loss, direct, seed, method)
|
||||
print(key, 'selected step', optimization['searches'][key]['selected_step'], flush=True)
|
||||
validation_scores = {key: val_loss(w) for key, w in weights.items()}
|
||||
chosen = min(weights, key=validation_scores.get)
|
||||
write_json(out / 'frozen.json', {'validation_winner': chosen,
|
||||
'validation_nll': validation_scores, 'optimization': optimization,
|
||||
'weights': {k: w.tolist() for k, w in weights.items()}})
|
||||
|
||||
result = {}
|
||||
for split in SPLITS:
|
||||
data = load_split(cache, split)
|
||||
if data['ids'].tolist() != [ex['id'] for ex in problems[split]]:
|
||||
raise ValueError(f'Capture order differs for {split}')
|
||||
native = model.forward(data, data['teacher'])
|
||||
err = float(np.max(np.abs(native - data['hidden'])))
|
||||
if not np.allclose(native, data['hidden'], atol=3e-5, rtol=2e-5):
|
||||
raise AssertionError(f'{split} native full-prefix vs last-query parity failed: {err}')
|
||||
states = {'native': native, **{k: model.forward(data, transform(data, w))
|
||||
for k, w in weights.items()}}
|
||||
modes = list(states)
|
||||
greedy = np.split(model.greedy(np.concatenate(list(states.values()))), len(states))
|
||||
labels = data['labels']
|
||||
gold = data['gold']
|
||||
result[split] = {}
|
||||
groups = {}
|
||||
for i, ex in enumerate(problems[split]):
|
||||
groups.setdefault(f"{ex['entries']}-entries", []).append(i)
|
||||
groups.setdefault('duplicate' if ex['duplicate'] else 'unique', []).append(i)
|
||||
for key, pred in zip(modes, greedy):
|
||||
logits = states[key] @ model.digits(labels).T
|
||||
losses = digit_losses(logits, gold)
|
||||
correct = logits.argmax(axis=1) == gold
|
||||
exact = pred == labels[gold]
|
||||
result[split][key] = {'digit_accuracy': int(correct.sum()),
|
||||
'greedy_exact_digit': int(exact.sum()),
|
||||
'by_group': {g: {'n': len(ix), 'digit_accuracy': int(correct[ix].sum()),
|
||||
'greedy_exact_digit': int(exact[ix].sum()),
|
||||
'digit_nll': float(losses[ix].mean())}
|
||||
for g, ix in groups.items()},
|
||||
'n': len(gold), 'digit_nll': float(losses.mean()),
|
||||
'loss_by_item': losses.tolist(), 'greedy_ids': pred.tolist(),
|
||||
'digit_logits': logits.tolist()}
|
||||
print(split, 'native parity max abs', err, flush=True)
|
||||
write_json(out / 'metrics.json', result)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--source', required=True, type=Path)
|
||||
parser.add_argument('--cache', required=True, type=Path)
|
||||
parser.add_argument('--out', required=True, type=Path)
|
||||
args = parser.parse_args()
|
||||
args.out.mkdir()
|
||||
run(args.source, args.cache, args.out)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,136 @@
|
||||
"""Evaluate all predeclared models on fresh counterfactual pairs."""
|
||||
import argparse
|
||||
import json
|
||||
from pathlib import Path
|
||||
from time import monotonic
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
from tokenizers import Tokenizer
|
||||
|
||||
from crossqkv.lisa_combination_screen import ADAPTER_SHA, SITES
|
||||
from crossqkv.lisa_full_answer import evaluate, fingerprint
|
||||
from crossqkv.lisa_full_answer_verify import verify
|
||||
from crossqkv.lisa_rank_compare import make_adapters
|
||||
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)
|
||||
pairwise = {}
|
||||
for name, delta in comparisons.items():
|
||||
if name != 'rank-interaction':
|
||||
pairwise[name] = {'corrected': ids[delta > 0].tolist(),
|
||||
'lost': ids[delta < 0].tolist()}
|
||||
|
||||
versus_share = comparisons['rank-vs-uniform']
|
||||
versus_allocation = comparisons['rank-vs-local']
|
||||
both = {}
|
||||
for name, sign in [('corrected_against_both', 1), ('lost_against_both', -1)]:
|
||||
mask = (versus_share == sign) & (versus_allocation == sign)
|
||||
both[name] = [{'id': item_id, 'local_uniform_correct': bool(correct)}
|
||||
for item_id, correct in zip(ids[mask].tolist(), local_uniform[mask])]
|
||||
return {'pairwise': pairwise, 'rank_combination': both}
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
for name in ('source','prior','out'):
|
||||
parser.add_argument('--'+name, type=Path, required=True)
|
||||
args = parser.parse_args()
|
||||
torch.set_num_threads(1)
|
||||
path = args.out/'protocol.json'
|
||||
if fingerprint(path) != '6858dbc64db0b989e8112e9dbea70662a2a05f66f11b180e8f2c668c74c43aef':
|
||||
raise ValueError('Frozen protocol mismatch')
|
||||
questions = json.loads(path.read_text())['splits']['test']
|
||||
prior_protocol = json.loads((args.prior/'frozen.json').read_text())['protocol']
|
||||
config = json.loads((args.source/'model_config.json').read_text())
|
||||
tok = Tokenizer.from_file(str(args.source/'tokenizer.json'))
|
||||
out = args.out/'holdout'
|
||||
out.mkdir(exist_ok=True)
|
||||
scores = {}
|
||||
generation = {}
|
||||
for arm in ('native','direct','prior-lisa','trajectory-student','trajectory-reference',
|
||||
'shared-uniform','shared-allocated','shared-reversed','local-uniform','local-allocated'):
|
||||
model = StreamingLM(args.source/'weights', config, seconds=172800,process_swap_limit_kib=None)
|
||||
sites = () if arm=='native' else SITES
|
||||
adapters = None
|
||||
if arm not in ('native','direct'):
|
||||
ranks = dict.fromkeys(SITES,40)
|
||||
shared = True
|
||||
if arm=='prior-lisa':
|
||||
weights = args.prior/'final/lisa.pt'
|
||||
if fingerprint(weights) != ADAPTER_SHA:
|
||||
raise ValueError('Incorrect starting checkpoint')
|
||||
elif arm.startswith('trajectory-'):
|
||||
weights = args.out/arm/'adapter.pt'
|
||||
else:
|
||||
spec = json.loads((args.out/arm/'config.json').read_text())
|
||||
ranks = {int(k):v for k,v in spec['ranks'].items()}
|
||||
shared = spec['shared']
|
||||
weights = args.out/arm/'lisa.pt'
|
||||
adapters = make_adapters(model.config,ranks,shared)
|
||||
torch.nn.ModuleDict({str(i):v for i,v in adapters.items()}).load_state_dict(
|
||||
torch.load(weights,weights_only=True,map_location='cpu'))
|
||||
digest = fingerprint(weights)
|
||||
else:
|
||||
digest = prior_protocol['weights']['manifest.json']
|
||||
lock = out/(arm+'-source.json')
|
||||
if lock.exists() and json.loads(lock.read_text()) != digest:
|
||||
raise ValueError('Cannot resume with changed weights')
|
||||
write_json(lock,digest)
|
||||
path = out/(arm+'.json')
|
||||
rows = json.loads(path.read_text()) if path.exists() else []
|
||||
if rows:
|
||||
verify(tok,prior_protocol,questions,rows,(arm,),allow_prefix=True)
|
||||
for start in range(len(rows),len(questions),2):
|
||||
batch = questions[start:start+2]
|
||||
before = monotonic()
|
||||
generated = evaluate(model,tok,batch,{arm:sites},adapters)
|
||||
seconds = monotonic() - before
|
||||
verify(tok,prior_protocol,batch,generated,(arm,))
|
||||
generated[0]['batch_seconds'] = seconds
|
||||
rows.extend(generated)
|
||||
write_json(path,rows)
|
||||
print(arm,len(rows),'/',len(questions),flush=True)
|
||||
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 = 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),
|
||||
'generation':generation,
|
||||
'changed_answers':changed_answers(questions,comparisons,scores['local-uniform']),
|
||||
'correct':{k:int(v.sum()) for k,v in scores.items()},
|
||||
'pairs_both_correct':{k:int(v.all(1).sum()) for k,v in scores.items()},
|
||||
'paired_differences':{k:{'delta':float(v.mean()),
|
||||
'interval_95':np.quantile(v.mean(1)[sample].mean(1),[.025,.975]).tolist()}
|
||||
for k,v in comparisons.items()}}
|
||||
write_json(out/'audit.json',audit)
|
||||
|
||||
|
||||
if __name__=='__main__':
|
||||
main()
|
||||
@@ -0,0 +1,90 @@
|
||||
"""Freeze paired lookup questions and restore individual native attention layers."""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import random
|
||||
from pathlib import Path
|
||||
|
||||
import torch
|
||||
from tokenizers import Tokenizer
|
||||
|
||||
from crossqkv.lisa_effect_screen import WORDS
|
||||
from crossqkv.lisa_full_answer import evaluate
|
||||
from crossqkv.lisa_train import LearnableSharingAttention
|
||||
from functional.model import StreamingLM
|
||||
from functional.run import write_json
|
||||
|
||||
|
||||
SITES = (15, 19, 23)
|
||||
ADAPTER_SHA = 'c82db5af7fa42cf58a349f3e53961da2360b211a7ed606f53a728860c64f6f29'
|
||||
|
||||
|
||||
def paired_questions(split, pairs, seed):
|
||||
rng = random.Random(seed)
|
||||
rows = []
|
||||
for i in range(pairs):
|
||||
keys = rng.sample(WORDS, 12)
|
||||
values = rng.sample(range(20, 100), 12)
|
||||
target, foil = rng.sample(range(12), 2)
|
||||
for variant in range(2):
|
||||
records = ', '.join(f'{k}={v}' for k, v in zip(keys, values))
|
||||
rows.append({'id': f'{split}-{i:03}-{variant}', 'task': 'lookup',
|
||||
'question': f'Records in time order: {records}.\nWhat is the recorded number for {keys[target]}?',
|
||||
'answer': values[target]})
|
||||
values[target], values[foil] = values[foil], values[target]
|
||||
return rows
|
||||
|
||||
|
||||
def main():
|
||||
p = argparse.ArgumentParser(description=__doc__)
|
||||
for name in ('source', 'prior', 'out'):
|
||||
p.add_argument('--'+name, type=Path, required=True)
|
||||
args = p.parse_args()
|
||||
args.out.mkdir(exist_ok=True, parents=True)
|
||||
previous = json.loads((args.prior/'frozen.json').read_text())
|
||||
splits = {s: paired_questions(s, n, seed) for s, n, seed in (
|
||||
('diagnostic', 8, 72501), ('validation', 8, 72502), ('test', 32, 72503))}
|
||||
seen = {r['question'] for rows in previous['problems'].values() for r in rows}
|
||||
for rows in splits.values():
|
||||
for row in rows:
|
||||
if row['question'] in seen:
|
||||
raise ValueError('Repeated question')
|
||||
seen.add(row['question'])
|
||||
spec = {'splits': splits, 'base_adapter': ADAPTER_SHA, 'sites': SITES,
|
||||
'rank_budget': [32, 40, 48], 'uniform_rank': 40, 'cap': 24,
|
||||
'rank_selection': 'Order layers by increase in complete-answer correct count upon single restoration; ties by ascending layer index, earlier gets higher rank.',
|
||||
'primary_metric': 'complete answer accuracy; paired uncertainty resamples counterfactual pairs',
|
||||
'secondary_metric': 'both members of pair correct'}
|
||||
spec_path = args.out/'protocol.json'
|
||||
if spec_path.exists() and json.loads(spec_path.read_text()) != json.loads(json.dumps(spec)):
|
||||
raise ValueError('Protocol changed')
|
||||
write_json(spec_path, spec)
|
||||
weight_path = args.prior/'final/lisa.pt'
|
||||
if hashlib.sha256(weight_path.read_bytes()).hexdigest() != ADAPTER_SHA:
|
||||
raise ValueError('Prior adapter mismatch')
|
||||
torch.set_num_threads(1)
|
||||
c = json.loads((args.source/'model_config.json').read_text())
|
||||
model = StreamingLM(args.source/'weights', c, seconds=172800, process_swap_limit_kib=None)
|
||||
c = model.config
|
||||
tok = Tokenizer.from_file(str(args.source/'tokenizer.json'))
|
||||
adapters = torch.nn.ModuleDict({str(i): LearnableSharingAttention(c['hidden_size'],
|
||||
c['num_attention_heads'], c['num_key_value_heads'], 40, c['rope_parameters']['rope_theta'],
|
||||
c['rope_parameters']['partial_rotary_factor'], bias=c.get('attention_bias', False)) for i in SITES})
|
||||
adapters.load_state_dict(torch.load(weight_path, weights_only=True, map_location='cpu'))
|
||||
for restored in (None, *SITES):
|
||||
active = tuple(i for i in SITES if i != restored)
|
||||
label = 'baseline' if restored is None else f'restore-{restored}'
|
||||
path = args.out/(label+'.json')
|
||||
rows = json.loads(path.read_text()) if path.exists() else []
|
||||
questions = splits['diagnostic']
|
||||
if [r['id'] for r in rows] != [q['id'] for q in questions[:len(rows)]]:
|
||||
raise ValueError('Diagnostic prefix mismatch')
|
||||
for start in range(len(rows), len(questions), 2):
|
||||
rows.extend(evaluate(model, tok, questions[start:start+2], {label: active},
|
||||
{i: adapters[str(i)] for i in active}))
|
||||
write_json(path, rows)
|
||||
print(label, len(rows), flush=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,101 @@
|
||||
"""Incremental full-attention sites for measuring LiSA's real K/V allocation.
|
||||
|
||||
The scheduler supplies the earlier full-attention site's raw score row for
|
||||
the same query. This file measures an attention site, excluding GDN, MLP,
|
||||
embedding, and scheduler overhead.
|
||||
"""
|
||||
import math
|
||||
|
||||
import torch
|
||||
|
||||
from crossqkv.lisa_tail import TorchTail, rotate
|
||||
|
||||
|
||||
class AttentionSiteCache:
|
||||
def __init__(self, tail: TorchTail, layer, batch_size, capacity, adapter=None,
|
||||
dtype=torch.float32):
|
||||
self.tail, self.adapter = tail, adapter
|
||||
self.name = f'layers.{layer}.self_attn.'
|
||||
self.heads = tail.c['num_attention_heads']
|
||||
self.kv_heads = tail.c['num_key_value_heads']
|
||||
self.head_dim = tail.c['head_dim']
|
||||
self.key_dim = adapter.rank if adapter is not None else self.head_dim
|
||||
self.capacity = capacity
|
||||
self.next_position = 0
|
||||
self.k = torch.empty(batch_size, capacity, self.kv_heads, self.key_dim, dtype=dtype)
|
||||
self.v = torch.empty(batch_size, capacity, self.kv_heads, self.head_dim, dtype=dtype)
|
||||
rp = tail.c['rope_parameters']
|
||||
n = int(self.head_dim * rp['partial_rotary_factor'])
|
||||
self.rotary_frequency = rp['rope_theta'] ** (-torch.arange(0, n, 2, dtype=dtype) / n)
|
||||
|
||||
def reset(self):
|
||||
self.next_position = 0
|
||||
|
||||
@property
|
||||
def allocated_bytes(self):
|
||||
return {'k': self.k.numel()*self.k.element_size(),
|
||||
'v': self.v.numel()*self.v.element_size()}
|
||||
|
||||
def native_rotate(self, x, position):
|
||||
angle = self.rotary_frequency * position
|
||||
a, b = x[..., :2*len(angle)].chunk(2, -1)
|
||||
angle = torch.cat((angle, angle))
|
||||
return torch.cat((torch.cat((a, b), -1)*angle.cos()
|
||||
+ torch.cat((-b, a), -1)*angle.sin(),
|
||||
x[..., 2*len(self.rotary_frequency):]), -1)
|
||||
|
||||
@torch.no_grad()
|
||||
def prefill(self, h):
|
||||
"""Populate K/V from a fresh prefix without scoring its queries."""
|
||||
n = h.shape[1]
|
||||
if h.shape[0] != self.k.shape[0] or n > self.capacity:
|
||||
raise ValueError('Prefix does not fit the attention cache')
|
||||
base, name = self.tail, self.name
|
||||
if self.adapter is None:
|
||||
rp = base.c['rope_parameters']
|
||||
k = base.linear(h, name+'k_proj').unflatten(-1, (self.kv_heads, self.head_dim))
|
||||
k = rotate(base.norm(k, name+'k_norm'), rp['rope_theta'], rp['partial_rotary_factor'])
|
||||
else:
|
||||
a = self.adapter
|
||||
k = a.k_proj(h).unflatten(-1, (self.kv_heads, self.key_dim))
|
||||
k = a.rotate(k, torch.arange(n, device=h.device)[None, :])
|
||||
self.k[:, :n].copy_(k)
|
||||
self.v[:, :n].copy_(base.linear(h, name+'v_proj').unflatten(-1, (self.kv_heads, self.head_dim)))
|
||||
self.next_position = n
|
||||
|
||||
@torch.no_grad()
|
||||
def step(self, h, donor=None):
|
||||
"""h has shape (batch, 1, hidden). Return output and unmasked score row."""
|
||||
pos = self.next_position
|
||||
if h.shape[:2] != (self.k.shape[0], 1) or pos >= self.capacity:
|
||||
raise ValueError('Wrong input shape or full attention cache')
|
||||
if self.adapter is not None and (donor is None or
|
||||
donor.shape != (len(h), self.heads, 1, pos+1)):
|
||||
raise ValueError('LiSA requires the upstream score row for its full prefix')
|
||||
base = self.tail
|
||||
name = self.name
|
||||
if self.adapter is None:
|
||||
packed = base.linear(h, name+'q_proj').unflatten(-1, (self.heads, 2*self.head_dim))
|
||||
q, gate = packed.chunk(2, -1)
|
||||
k = base.linear(h, name+'k_proj').unflatten(-1, (self.kv_heads, self.head_dim))
|
||||
q = self.native_rotate(base.norm(q, name+'q_norm'), pos)
|
||||
k = self.native_rotate(base.norm(k, name+'k_norm'), pos)
|
||||
else:
|
||||
a = self.adapter
|
||||
position = torch.tensor([[pos]], device=h.device)
|
||||
q = a.rotate(a.q_proj(h).unflatten(-1, (self.heads, self.key_dim)), position)
|
||||
k = a.rotate(a.k_proj(h).unflatten(-1, (self.kv_heads, self.key_dim)), position)
|
||||
gate = base.gate_only(h, name)
|
||||
v = base.linear(h, name+'v_proj').unflatten(-1, (self.kv_heads, self.head_dim))
|
||||
self.k[:, pos:pos+1].copy_(k)
|
||||
self.v[:, pos:pos+1].copy_(v)
|
||||
self.next_position += 1
|
||||
groups = self.heads // self.kv_heads
|
||||
keys = self.k[:, :pos+1].repeat_interleave(groups, 2)
|
||||
values = self.v[:, :pos+1].repeat_interleave(groups, 2)
|
||||
scores = torch.einsum('bthd,bshd->bhts', q, keys) / math.sqrt(self.key_dim)
|
||||
if self.adapter is not None:
|
||||
both = torch.cat((scores, donor), dim=1).permute(0, 2, 3, 1)
|
||||
scores = self.adapter.fuse(both).permute(0, 3, 1, 2)
|
||||
context = torch.einsum('bhts,bshd->bthd', scores.softmax(-1), values)
|
||||
return base.linear((context * gate.sigmoid()).flatten(-2), name+'o_proj'), scores
|
||||
@@ -0,0 +1,130 @@
|
||||
"""Measure real K/V allocation and isolated incremental attention on Qwen."""
|
||||
import argparse
|
||||
import json
|
||||
import time
|
||||
from statistics import median
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
from torch.nn import functional as F
|
||||
|
||||
from crossqkv.lisa_decode import AttentionSiteCache
|
||||
from crossqkv.lisa_tail import TorchTail, weight_chunks
|
||||
from crossqkv.lisa_train import LearnableSharingAttention
|
||||
from functional.model import PREFIX, StreamingLM
|
||||
from functional.run import write_json
|
||||
|
||||
|
||||
class TracedTail(TorchTail):
|
||||
def full(self, h, layer, donor, lengths, mode, recipients, keep_teacher):
|
||||
self.inputs[layer] = (h, donor)
|
||||
return super().full(h, layer, donor, lengths, mode, recipients, keep_teacher)
|
||||
|
||||
|
||||
class ResidentSite:
|
||||
"""Keep one site's frozen projections resident to isolate compute latency."""
|
||||
|
||||
def __init__(self, tail, layer):
|
||||
self.tail, self.c = tail, tail.c
|
||||
self.name = f'layers.{layer}.self_attn.'
|
||||
self.weights = {}
|
||||
for k in ('q_proj', 'k_proj', 'v_proj', 'o_proj'):
|
||||
t = tail.source.tensors[PREFIX + self.name + k + '.weight']
|
||||
self.weights[self.name+k] = torch.cat(list(weight_chunks(t, 0, t.shape[0])))
|
||||
w = self.weights[self.name+'q_proj']
|
||||
heads, dim = self.c['num_attention_heads'], self.c['head_dim']
|
||||
self.gate_weight = w.reshape(heads, 2*dim, -1)[:, dim:].reshape(heads*dim, -1).contiguous()
|
||||
|
||||
def linear(self, h, name, start=0, end=None):
|
||||
return F.linear(h, self.weights[name][start:end])
|
||||
|
||||
def gate_only(self, h, name):
|
||||
if name != self.name:
|
||||
raise ValueError('Resident gate called for the wrong site')
|
||||
return F.linear(h, self.gate_weight).unflatten(-1,
|
||||
(self.c['num_attention_heads'], self.c['head_dim']))
|
||||
|
||||
def norm(self, *args):
|
||||
return self.tail.norm(*args)
|
||||
|
||||
|
||||
def timed_site(groups, h, donor, n, samples=3, rounds=4):
|
||||
timings = {k: [] for k in groups}
|
||||
states = {}
|
||||
for i in range(rounds):
|
||||
order = tuple(groups) if i % 2 == 0 else tuple(reversed(groups))
|
||||
for mode in order:
|
||||
cache = groups[mode]
|
||||
cache.reset()
|
||||
cache.prefill(h[:, :n-samples])
|
||||
for pos in range(n-samples, n):
|
||||
row = donor[:, :, pos:pos+1, :pos+1].contiguous() if mode == 'lisa' else None
|
||||
start = time.perf_counter()
|
||||
result, attention = cache.step(h[:, pos:pos+1], row)
|
||||
elapsed = time.perf_counter() - start
|
||||
if i:
|
||||
timings[mode].append(elapsed)
|
||||
if not torch.isfinite(result).all():
|
||||
raise FloatingPointError('Invalid cached decode')
|
||||
states[mode] = result, attention
|
||||
return timings, states
|
||||
|
||||
|
||||
def run(source, capture, checkpoint, out):
|
||||
torch.set_num_threads(1)
|
||||
spec = json.loads((capture/'selection.json').read_text())
|
||||
sites = spec['sites']
|
||||
source = StreamingLM(source/'weights', json.loads((source/'model_config.json').read_text()))
|
||||
cfg = source.config
|
||||
rope = cfg['rope_parameters']
|
||||
adap = {i: LearnableSharingAttention(cfg['hidden_size'], cfg['num_attention_heads'],
|
||||
cfg['num_key_value_heads'], 40, rope['rope_theta'], rope['partial_rotary_factor'],
|
||||
bias=cfg.get('attention_bias', False)) for i in sites}
|
||||
tail = TracedTail(source, sites[0], adap)
|
||||
tail.adapters.load_state_dict(torch.load(checkpoint, map_location='cpu', weights_only=True))
|
||||
with np.load(sorted(capture.glob('validation-*.npz'))[0], allow_pickle=False) as f:
|
||||
n = int(f['lengths'][0])
|
||||
data = {k: torch.from_numpy(f[k][:1]) for k in ('residual', 'donor', 'lengths')}
|
||||
data['residual'] = data['residual'][:, :n]
|
||||
data['donor'] = data['donor'][:, :, :n, :n]
|
||||
tail.inputs = {}
|
||||
measurements = {}
|
||||
with torch.no_grad():
|
||||
tail(data['residual'], data['donor'], data['lengths'], 'native', ())
|
||||
for layer in sites:
|
||||
h, donor = tail.inputs[layer]
|
||||
groups = {'native': AttentionSiteCache(tail, layer, 1, n),
|
||||
'lisa': AttentionSiteCache(tail, layer, 1, n, adap[layer])}
|
||||
timings, reference = timed_site(groups, h, donor, n)
|
||||
resident = ResidentSite(tail, layer)
|
||||
resident_groups = {mode: AttentionSiteCache(resident, layer, 1, n,
|
||||
adap[layer] if mode == 'lisa' else None) for mode in groups}
|
||||
warm, checked = timed_site(resident_groups, h, donor, n)
|
||||
for mode in groups:
|
||||
for actual, expected in zip(checked[mode], reference[mode]):
|
||||
torch.testing.assert_close(actual, expected, rtol=5e-5, atol=5e-5)
|
||||
measurements[layer] = {'seconds_per_token': timings,
|
||||
'resident_seconds_per_token': warm,
|
||||
'resident_median_s_per_token': {k: median(v) for k,v in warm.items()},
|
||||
'resident_matches_streamed': True,
|
||||
'allocated_bytes': {k: v.allocated_bytes for k, v in groups.items()},
|
||||
'lisa_input_score_row_bytes': (
|
||||
cfg['num_attention_heads'] * n * h.element_size()),
|
||||
'sequence_length': n}
|
||||
write_json(out, {'scope': 'isolated full-attention recipient, FP32, frozen true activations; '
|
||||
'excludes donor generation and full-model decode', 'sites': measurements,
|
||||
'streamed_timings_include_weight_reads': True,
|
||||
'resident_timings_exclude_projection_load': True})
|
||||
|
||||
|
||||
def main():
|
||||
p = argparse.ArgumentParser(description=__doc__)
|
||||
for name in ('source', 'capture', 'checkpoint', 'out'):
|
||||
p.add_argument('--'+name, type=Path, required=True)
|
||||
a = p.parse_args()
|
||||
run(a.source, a.capture, a.checkpoint, a.out)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,296 @@
|
||||
"""Train matched multi-recipient sharing adapters and evaluate the frozen test set."""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
|
||||
from crossqkv.core import QKVModel
|
||||
from crossqkv.lisa_effect_screen import TASKS
|
||||
from crossqkv.lisa_pilot import batch, scores
|
||||
from functional.model import PREFIX
|
||||
from functional.run import write_json
|
||||
|
||||
CANDIDATES = ('linear', 'lisa', 'lisa_answer_weighted')
|
||||
|
||||
|
||||
def selection(screen):
|
||||
eligible = []
|
||||
for task, modes in screen.items():
|
||||
base = modes['native']
|
||||
if base['correct'] < 5:
|
||||
continue
|
||||
for name, sites in [('direct_23', [23]), ('direct_19_23', [19, 23])]:
|
||||
row = modes[name]
|
||||
if row['native_wins_lost']:
|
||||
eligible.append((row['native_wins_lost'], len(sites),
|
||||
base['correct']-row['correct'], task, sites))
|
||||
if not eligible:
|
||||
raise ValueError('No task/schedule met the prespecified development eligibility rule')
|
||||
_, _, _, task, sites = max(eligible)
|
||||
return {'task': task, 'sites': sites}
|
||||
|
||||
|
||||
class Capture(QKVModel):
|
||||
def normalization(self, x, name):
|
||||
if name == f'layers.{self.first}.input_layernorm':
|
||||
self.residual = x
|
||||
return super().normalization(x, name)
|
||||
|
||||
def full_attention(self, h, layer, shared_p=None):
|
||||
if layer != self.first - 4:
|
||||
return super().full_attention(h, layer, shared_p)
|
||||
part = self.parts(h, layer, heads=False)
|
||||
self.donor = scores(part['q'], part['k'])
|
||||
return part['output'], part['p']
|
||||
|
||||
|
||||
def capture(source, screen_dir, out, schedule):
|
||||
from tokenizers import Tokenizer
|
||||
|
||||
fixed_path = screen_dir/'fixed-problems.json'
|
||||
fixed = json.loads(fixed_path.read_text())
|
||||
chosen = selection(json.loads((screen_dir/'screen-summary.json').read_text()))
|
||||
if schedule == 'chain':
|
||||
modes = json.loads((screen_dir/'screen-summary.json').read_text())[chosen['task']]
|
||||
if not modes['direct_19_23']['native_wins_lost']:
|
||||
raise ValueError('The development-selected task has no recorded losses under the chain')
|
||||
chosen['sites'] = [19, 23]
|
||||
model = Capture(source/'weights', json.loads((source/'model_config.json').read_text()),
|
||||
seconds=7200)
|
||||
model.first = chosen['sites'][0]
|
||||
tok = Tokenizer.from_file(str(source/'tokenizer.json'))
|
||||
sha = lambda path: hashlib.sha256(path.read_bytes()).hexdigest()
|
||||
write_json(out/'selection.json', {**chosen, 'fixed_problems_sha256': sha(fixed_path),
|
||||
'source_sha256': {n: sha(source/n) for n in
|
||||
('manifest.json', 'model_config.json', 'tokenizer.json')}})
|
||||
for split in ('fit', 'validation', 'test'):
|
||||
selected = [ex for ex in fixed[split] if ex['task'] == chosen['task']]
|
||||
for start in range(0, len(selected), 4):
|
||||
group = selected[start:start+4]
|
||||
ids, lengths, labels = batch(tok, group)
|
||||
gold = np.array([r['answer_index'] for r in group])
|
||||
ids = np.pad(ids, ((0, 0), (0, 1)))
|
||||
ids[np.arange(len(group)), lengths] = np.asarray(labels)[gold]
|
||||
h, _ = model.forward(ids)
|
||||
pending = out/f'{split}-{start:03}.tmp.npz'
|
||||
np.savez(pending, ids=ids, lengths=np.asarray(lengths)+1, labels=labels, gold=gold,
|
||||
residual=model.residual, donor=model.donor, expected=h,
|
||||
names=[x['id'] for x in group])
|
||||
pending.replace(out/f'{split}-{start:03}.npz')
|
||||
print('capture', split, start+len(group), '/', len(selected), flush=True)
|
||||
|
||||
|
||||
def train(source, cache, out, epochs, resume=False):
|
||||
import torch
|
||||
from torch import nn
|
||||
from crossqkv.lisa_tail import TorchTail
|
||||
from crossqkv.lisa_train import LearnableSharingAttention, huber_distillation, language_model_loss
|
||||
from functional.model import StreamingLM
|
||||
|
||||
torch.set_num_threads(1)
|
||||
torch.manual_seed(415005)
|
||||
spec = json.loads((cache/'selection.json').read_text())
|
||||
if any(hashlib.sha256((source/n).read_bytes()).hexdigest() != s
|
||||
for n, s in spec['source_sha256'].items()):
|
||||
raise ValueError('Checkpoint provenance mismatch')
|
||||
expected_batches = {'fit':12, 'validation':12, 'test':32}
|
||||
for split, count in expected_batches.items():
|
||||
actual = 0
|
||||
for p in cache.glob(f'{split}-*.npz'):
|
||||
with np.load(p, allow_pickle=False) as b:
|
||||
actual += len(b['names'])
|
||||
if actual != count:
|
||||
raise ValueError(f'Expected {count} {split} examples, found {actual}')
|
||||
run_config = {'epochs': epochs, 'selection': spec, 'optimizer': 'AdamW',
|
||||
'lr': .0003, 'weight_decay': .1, 'answer_weight': 16., 'seed': 415005}
|
||||
config_path = out/'train-protocol.json'
|
||||
if resume:
|
||||
if json.loads(config_path.read_text()) != run_config:
|
||||
raise ValueError('Training configuration differs from the original run')
|
||||
else:
|
||||
write_json(config_path, run_config)
|
||||
model = StreamingLM(source/'weights', json.loads((source/'model_config.json').read_text()))
|
||||
sites = tuple(spec['sites'])
|
||||
cfg = model.config
|
||||
heads = cfg['num_attention_heads']
|
||||
rope = cfg['rope_parameters']
|
||||
t = model.tensors[PREFIX+'embed_tokens.weight']
|
||||
|
||||
def vocab():
|
||||
for start in range(0, t.shape[0], 1024):
|
||||
end = min(start+1024, t.shape[0])
|
||||
yield start, torch.from_numpy(t.read(slice(start*t.shape[1], end*t.shape[1]))
|
||||
.reshape(end-start, t.shape[1]))
|
||||
t.evict()
|
||||
|
||||
def batches(split, micro=False):
|
||||
for path in sorted(cache.glob(f'{split}-*.npz')):
|
||||
with np.load(path, allow_pickle=False) as f:
|
||||
b = {k: torch.from_numpy(f[k]) for k in f.files if k != 'names'}
|
||||
names = f['names'].tolist()
|
||||
if not micro:
|
||||
yield b, names
|
||||
else:
|
||||
for j, name in enumerate(names):
|
||||
yield {k: v if k == 'labels' else v[j:j+1] for k, v in b.items()}, [name]
|
||||
|
||||
def make(candidate):
|
||||
torch.manual_seed(415005)
|
||||
if candidate == 'linear':
|
||||
blocks = {i: nn.Linear(heads, heads, bias=False) for i in sites}
|
||||
for value in blocks.values():
|
||||
with torch.no_grad():
|
||||
value.weight.copy_(torch.eye(heads))
|
||||
else:
|
||||
blocks = {i: LearnableSharingAttention(cfg['hidden_size'], heads,
|
||||
cfg['num_key_value_heads'], 40, rope['rope_theta'],
|
||||
rope['partial_rotary_factor'], bias=cfg.get('attention_bias', False))
|
||||
for i in sites}
|
||||
return TorchTail(model, sites[0], blocks)
|
||||
|
||||
def run(tail, b, mode, teacher=False):
|
||||
return tail(b['residual'], b['donor'], b['lengths'], mode, sites, teacher)
|
||||
|
||||
def score(h, b):
|
||||
index = b['lengths'] - 2
|
||||
f = h[torch.arange(len(index)), index]
|
||||
labels = b['labels'].tolist()
|
||||
weights = np.stack([t.read(slice(i*t.shape[1], (i+1)*t.shape[1])) for i in labels])
|
||||
t.evict()
|
||||
logits = f @ torch.from_numpy(weights).T
|
||||
nll = torch.logsumexp(logits, -1) - logits[torch.arange(len(index)), b['gold']]
|
||||
return logits, nll
|
||||
|
||||
def evaluate(tail, split, mode):
|
||||
rows = []
|
||||
with torch.no_grad():
|
||||
for b, names in batches(split):
|
||||
h, _ = run(tail, b, mode)
|
||||
if mode == 'native':
|
||||
valid = torch.arange(h.shape[1])[None] < b['lengths'][:, None]
|
||||
torch.testing.assert_close(h[valid], b['expected'][valid], rtol=7e-5, atol=8e-5)
|
||||
logits, nll = score(h, b)
|
||||
rows.extend({'id': name, 'gold': int(g), 'logits': x.tolist(),
|
||||
'pred': int(x.argmax()), 'answer_nll': float(v)}
|
||||
for name, g, x, v in zip(names, b['gold'], logits, nll))
|
||||
if not rows:
|
||||
raise ValueError(f'No cached rows for {split}')
|
||||
return rows
|
||||
|
||||
def mean_nll(rows):
|
||||
return sum(r['answer_nll'] for r in rows) / len(rows)
|
||||
|
||||
trace = {}
|
||||
for candidate in CANDIDATES:
|
||||
tail = make(candidate)
|
||||
mode = 'linear' if candidate == 'linear' else 'lisa'
|
||||
optim = torch.optim.AdamW(tail.parameters(), lr=.0003, weight_decay=.1)
|
||||
ans_weight = 16.0 if candidate == 'lisa_answer_weighted' else 1.0
|
||||
best = float('inf')
|
||||
best_weights = None
|
||||
trace[candidate] = []
|
||||
last = out/f'{candidate}-resume.pt'
|
||||
if resume and last.exists():
|
||||
state = torch.load(last, weights_only=True, map_location='cpu')
|
||||
tail.adapters.load_state_dict(state['parameters'])
|
||||
optim.load_state_dict(state['optimizer'])
|
||||
trace[candidate] = state['trace']
|
||||
best = state['best']
|
||||
best_weights = state['best_parameters']
|
||||
for epoch in range(len(trace[candidate]), epochs):
|
||||
loss_total = 0.
|
||||
count = 0
|
||||
for b, _ in batches('fit', micro=True):
|
||||
optim.zero_grad(set_to_none=True)
|
||||
h, layer = run(tail, b, mode, teacher=True)
|
||||
kd = torch.stack([huber_distillation(*layer[i], b['lengths']) for i in sites]).mean()
|
||||
ce = None if mode == 'linear' else language_model_loss(
|
||||
h, b['ids'], b['lengths'], vocab, answer_weight=ans_weight)
|
||||
loss = kd if ce is None else .25 * kd + .75 * ce
|
||||
loss.backward()
|
||||
if any(p.grad is None or not torch.isfinite(p.grad).all() for p in tail.parameters()):
|
||||
raise FloatingPointError('Invalid adapter gradients')
|
||||
optim.step()
|
||||
loss_total += float(loss.detach())
|
||||
count += 1
|
||||
rows = evaluate(tail, 'validation', mode)
|
||||
val = mean_nll(rows)
|
||||
trace[candidate].append({'epoch': epoch+1, 'fit_loss': loss_total/count,
|
||||
'validation_answer_nll': val})
|
||||
if val < best:
|
||||
best = val
|
||||
best_weights = {k: v.detach().clone() for k, v in tail.adapters.state_dict().items()}
|
||||
pending = last.with_suffix('.tmp')
|
||||
torch.save({'parameters': tail.adapters.state_dict(), 'optimizer': optim.state_dict(),
|
||||
'trace': trace[candidate], 'best': best, 'best_parameters': best_weights},
|
||||
pending)
|
||||
pending.replace(last)
|
||||
write_json(out/'trace.json', trace)
|
||||
print(candidate, epoch+1, 'validation answer NLL', val, flush=True)
|
||||
selected = out/f'{candidate}.pt'
|
||||
pending = selected.with_suffix('.tmp')
|
||||
torch.save(best_weights, pending)
|
||||
pending.replace(selected)
|
||||
|
||||
# All checkpoints are frozen before evaluating holdout. Native and direct
|
||||
# go through the same path, including numerical parity with NumPy.
|
||||
results = {}
|
||||
empty = TorchTail(model, sites[0])
|
||||
for mode in ('native', 'direct'):
|
||||
results[mode] = evaluate(empty, 'test', mode)
|
||||
for name in CANDIDATES:
|
||||
tail = make(name)
|
||||
tail.adapters.load_state_dict(torch.load(out/f'{name}.pt', map_location='cpu', weights_only=True))
|
||||
results[name] = evaluate(tail, 'test', 'linear' if name == 'linear' else 'lisa')
|
||||
write_json(out/'test-items.json', results)
|
||||
|
||||
b, _ = next(batches('validation'))
|
||||
b = {k: v if k == 'labels' else v[:1] for k, v in b.items()}
|
||||
trained = make('lisa')
|
||||
trained.adapters.load_state_dict(torch.load(out/'lisa.pt', weights_only=True))
|
||||
timing = {'native': [], 'direct': [], 'lisa': []}
|
||||
with torch.no_grad():
|
||||
for turn in range(4):
|
||||
modes = list(timing)
|
||||
for mode in modes[turn % 3:] + modes[:turn % 3]:
|
||||
t0 = time.perf_counter()
|
||||
_, _ = run(trained if mode == 'lisa' else empty, b, mode)
|
||||
if turn:
|
||||
timing[mode].append(time.perf_counter()-t0)
|
||||
tokens = int(b['lengths'][0])
|
||||
kv, d = cfg['num_key_value_heads'], cfg['head_dim']
|
||||
cache_bytes = {'scope': 'formula for one sequence, BF16 keys and score buffers',
|
||||
'native_recipient_key_bytes': len(sites)*tokens*kv*d*2,
|
||||
'lisa_recipient_key_bytes': len(sites)*tokens*kv*40*2,
|
||||
'one_shared_decode_score_row_bytes': heads*tokens*2,
|
||||
'one_full_prefill_score_matrix_bytes': heads*tokens*tokens*2}
|
||||
write_json(out/'performance.json', {'scope': 'cached-prefix last layers, prefill',
|
||||
'seconds': timing, 'real_tokens': tokens, 'cache_estimate': cache_bytes})
|
||||
|
||||
|
||||
def main():
|
||||
p = argparse.ArgumentParser(description=__doc__)
|
||||
p.add_argument('phase', choices=('capture', 'train'))
|
||||
p.add_argument('--source', required=True, type=Path)
|
||||
p.add_argument('--input', required=True, type=Path)
|
||||
p.add_argument('--out', required=True, type=Path)
|
||||
p.add_argument('--schedule', choices=('best','chain'), default='best')
|
||||
p.add_argument('--epochs', type=int, default=2)
|
||||
p.add_argument('--resume', action='store_true')
|
||||
a = p.parse_args()
|
||||
if a.epochs < 1:
|
||||
p.error('--epochs must be positive')
|
||||
if a.resume and a.phase != 'train':
|
||||
p.error('--resume is for training with saved epoch checkpoints')
|
||||
a.out.mkdir(exist_ok=a.resume)
|
||||
if a.phase == 'capture':
|
||||
capture(a.source, a.input, a.out, a.schedule)
|
||||
else:
|
||||
train(a.source, a.input, a.out, a.epochs, a.resume)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,115 @@
|
||||
"""Compare one vs two recipients on the same task using full-vocabulary answers."""
|
||||
import argparse
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
from torch.nn import functional as F
|
||||
|
||||
from crossqkv.lisa_tail import TorchTail, weight_chunks
|
||||
from crossqkv.lisa_train import LearnableSharingAttention
|
||||
from functional.model import PREFIX, StreamingLM
|
||||
from functional.run import write_json
|
||||
|
||||
|
||||
def vocabulary_scores(hidden, targets, embedding):
|
||||
n = len(hidden)
|
||||
peak = hidden.new_full((n,), -torch.inf)
|
||||
total = peak.clone()
|
||||
top = torch.zeros(n, dtype=torch.int64)
|
||||
true = torch.zeros_like(peak)
|
||||
start = 0
|
||||
for w in weight_chunks(embedding, 0, embedding.shape[0], rows=1024):
|
||||
logits = F.linear(hidden, w)
|
||||
total = torch.logaddexp(total, logits.logsumexp(dim=-1))
|
||||
values, indices = logits.max(dim=-1)
|
||||
top = torch.where(values > peak, indices + start, top)
|
||||
peak = torch.maximum(values, peak)
|
||||
local = (targets >= start) & (targets < start + len(w))
|
||||
true[local] = logits[local, targets[local]-start]
|
||||
start += len(w)
|
||||
return top, total-true
|
||||
|
||||
|
||||
def run(source, cache, trained, out):
|
||||
torch.set_num_threads(1)
|
||||
spec = json.loads((cache/'selection.json').read_text())
|
||||
sites = tuple(spec['sites'])
|
||||
stream = StreamingLM(source/'weights', json.loads((source/'model_config.json').read_text()))
|
||||
cfg = stream.config
|
||||
rp = cfg['rope_parameters']
|
||||
heads, kv = cfg['num_attention_heads'], cfg['num_key_value_heads']
|
||||
|
||||
def loaded(mode):
|
||||
if mode == 'linear':
|
||||
from torch import nn
|
||||
|
||||
modules = {site: nn.Linear(heads, heads, bias=False) for site in sites}
|
||||
else:
|
||||
modules = {site: LearnableSharingAttention(cfg['hidden_size'], heads, kv, 40,
|
||||
rp['rope_theta'], rp['partial_rotary_factor'],
|
||||
bias=cfg.get('attention_bias', False)) for site in sites}
|
||||
tail = TorchTail(stream, sites[0], modules)
|
||||
tail.adapters.load_state_dict(torch.load(trained/f'{mode}.pt', weights_only=True,
|
||||
map_location='cpu'))
|
||||
return tail
|
||||
|
||||
empty = TorchTail(stream, sites[0])
|
||||
fitted = loaded('lisa')
|
||||
arms = [('native', empty, 'native', ()),
|
||||
('direct_23', empty, 'direct', (sites[-1],)),
|
||||
('lisa_23_ablation', fitted, 'lisa', (sites[-1],))]
|
||||
if len(sites) > 1:
|
||||
arms.extend([('direct_chain', empty, 'direct', sites),
|
||||
('lisa_chain', fitted, 'lisa', sites)])
|
||||
arms.extend([('linear', loaded('linear'), 'linear', sites),
|
||||
('lisa_answer_weighted', loaded('lisa_answer_weighted'), 'lisa', sites)])
|
||||
answers = {name: [] for name, *_ in arms}
|
||||
ids, labels, options = [], [], []
|
||||
with torch.no_grad():
|
||||
for path in sorted(cache.glob('test-*.npz')):
|
||||
with np.load(path, allow_pickle=False) as f:
|
||||
b = {k: torch.from_numpy(f[k]) for k in f.files if k != 'names'}
|
||||
ids.extend(f['names'].tolist())
|
||||
labels.append(b['labels'][b['gold']])
|
||||
options.append(b['labels'].expand(len(b['gold']), -1))
|
||||
for name, tail, mode, chosen in arms:
|
||||
h, _ = tail(b['residual'], b['donor'], b['lengths'], mode, chosen)
|
||||
answers[name].append(h[torch.arange(len(h)), b['lengths']-2])
|
||||
print('matched full-vocabulary audit', len(ids), flush=True)
|
||||
if not ids:
|
||||
raise ValueError('No captured holdout batches')
|
||||
y = torch.cat(labels)
|
||||
t = stream.tensors[PREFIX+'embed_tokens.weight']
|
||||
hidden = torch.cat([torch.cat(answers[k]) for k in answers])
|
||||
pred, nll = vocabulary_scores(hidden, y.repeat(len(answers)), t)
|
||||
result = {}
|
||||
opts = torch.cat(options)
|
||||
for (name, h), p, v in zip(answers.items(), pred.split(len(y)), nll.split(len(y))):
|
||||
option_w = torch.stack([torch.from_numpy(t.read(slice(i*t.shape[1], (i+1)*t.shape[1])))
|
||||
for i in opts[0].tolist()])
|
||||
if not torch.equal(opts, opts[0].expand_as(opts)):
|
||||
raise ValueError('Option token IDs unexpectedly vary across items')
|
||||
t.evict()
|
||||
choice = opts[torch.arange(len(y)), F.linear(torch.cat(h), option_w).argmax(-1)]
|
||||
result[name] = {'n': len(y), 'full_vocab_correct': int((p==y).sum()),
|
||||
'four_choice_correct': int((choice==y).sum()),
|
||||
'full_vocab_nll': float(v.mean()),
|
||||
'rows': [{'id': key, 'gold_id': int(g), 'greedy_id': int(j),
|
||||
'choice_id': int(c), 'nll': float(s)}
|
||||
for key, g, j, c, s in zip(ids, y, p, choice, v)]}
|
||||
write_json(out, {'single_lisa_is_ablation_of_joint_checkpoint': len(sites) > 1,
|
||||
'candidate_sites': list(sites), 'arms': result})
|
||||
|
||||
|
||||
def main():
|
||||
p = argparse.ArgumentParser(description=__doc__)
|
||||
for name in ('source', 'cache', 'trained', 'out'):
|
||||
p.add_argument('--'+name, type=Path, required=True)
|
||||
a = p.parse_args()
|
||||
run(a.source, a.cache, a.trained, a.out)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,157 @@
|
||||
"""Independently validate frozen test outputs and report paired capability recovery."""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import math
|
||||
from pathlib import Path
|
||||
from statistics import median
|
||||
|
||||
import numpy as np
|
||||
|
||||
from functional.run import write_json
|
||||
|
||||
MODES = ('native', 'direct', 'linear', 'lisa', 'lisa_answer_weighted')
|
||||
|
||||
|
||||
def paired_interval(delta):
|
||||
rng = np.random.default_rng(415006)
|
||||
draw = rng.integers(0, len(delta), size=(10000, len(delta)))
|
||||
return np.quantile(delta[draw].mean(1), [.025, .975]).tolist()
|
||||
|
||||
|
||||
def paired(native, direct, candidate):
|
||||
damaged = native & ~direct
|
||||
rescued = damaged & candidate
|
||||
newly_lost = native & direct & ~candidate
|
||||
candidate_only = ~direct & candidate
|
||||
direct_only = direct & ~candidate
|
||||
delta = candidate.astype(int) - direct.astype(int)
|
||||
a, b = int(candidate_only.sum()), int(direct_only.sum())
|
||||
k = a + b
|
||||
p = min(1., 2. * sum(math.comb(k, i) for i in range(min(a, b)+1)) / 2**k)
|
||||
return {'native_correct_lost_by_direct': int(damaged.sum()), 'rescued': int(rescued.sum()),
|
||||
'newly_lost_among_native_and_direct_correct': int(newly_lost.sum()),
|
||||
'candidate_correct_direct_wrong': a, 'direct_correct_candidate_wrong': b,
|
||||
'accuracy_delta_vs_direct': float(delta.mean()),
|
||||
'paired_prompt_bootstrap_95': paired_interval(delta), 'mcnemar_exact_p': p}
|
||||
|
||||
|
||||
def loss_delta(losses, baseline):
|
||||
delta = losses - baseline
|
||||
return {'mean_delta': float(delta.mean()), 'paired_prompt_bootstrap_95': paired_interval(delta)}
|
||||
|
||||
|
||||
def full_vocab_metrics(path, expected, sites, choices):
|
||||
report = json.loads(path.read_text())
|
||||
chain = len(sites) > 1
|
||||
if (report['candidate_sites'] != sites
|
||||
or report['single_lisa_is_ablation_of_joint_checkpoint'] != chain):
|
||||
raise ValueError('Full-vocabulary layers differ from the locked schedule')
|
||||
arms = report['arms']
|
||||
mapped = {'native': 'native', 'linear': 'linear', 'lisa_answer_weighted': 'lisa_answer_weighted',
|
||||
'direct_chain' if chain else 'direct_23': 'direct',
|
||||
'lisa_chain' if chain else 'lisa_23_ablation': 'lisa'}
|
||||
if set(arms) != set(mapped) | {'direct_23', 'lisa_23_ablation'}:
|
||||
raise ValueError('Unexpected full-vocabulary arms')
|
||||
expected_ids = [name for name, _ in expected]
|
||||
correct, nll = {}, {}
|
||||
gold_ids = [row['gold_id'] for row in arms['native']['rows']]
|
||||
for mode, summary in arms.items():
|
||||
rows = summary['rows']
|
||||
if (summary['n'] != len(expected_ids) or [row['id'] for row in rows] != expected_ids
|
||||
or [row['gold_id'] for row in rows] != gold_ids):
|
||||
raise ValueError(f'{mode} vocabulary result does not match the locked rows')
|
||||
correct[mode] = np.array([row['greedy_id'] == row['gold_id'] for row in rows])
|
||||
nll[mode] = np.array([row['nll'] for row in rows])
|
||||
choice_correct = np.array([row['choice_id'] == row['gold_id'] for row in rows])
|
||||
if (not np.isfinite(nll[mode]).all() or (nll[mode] < 0).any()
|
||||
or int(correct[mode].sum()) != summary['full_vocab_correct']
|
||||
or int(choice_correct.sum()) != summary['four_choice_correct']
|
||||
or not np.isclose(nll[mode].mean(), summary['full_vocab_nll'])):
|
||||
raise ValueError(f'Invalid vocabulary metrics for {mode}')
|
||||
if mode in mapped and not np.array_equal(choice_correct, choices[mapped[mode]]):
|
||||
raise ValueError(f'{mode} choices differ across the two evaluations')
|
||||
matches = {'lisa_23_ablation': 'direct_23',
|
||||
'native': 'direct_chain' if chain else 'direct_23',
|
||||
'linear': 'direct_chain' if chain else 'direct_23',
|
||||
'lisa_answer_weighted': 'direct_chain' if chain else 'direct_23'}
|
||||
if chain:
|
||||
matches['lisa_chain'] = 'direct_chain'
|
||||
return {
|
||||
'arms': {mode: {'correct': int(correct[mode].sum()), 'answer_nll': float(nll[mode].mean())}
|
||||
for mode in arms},
|
||||
'matched_direct_comparisons': {
|
||||
mode: {'baseline': direct, 'answer_nll_delta': loss_delta(nll[mode], nll[direct]),
|
||||
**paired(correct['native'], correct[direct], correct[mode])}
|
||||
for mode, direct in matches.items()},
|
||||
}
|
||||
|
||||
|
||||
def audit(fixed, selection, items, perf=None, decode=None, full_vocab=None):
|
||||
spec = json.loads(selection.read_text())
|
||||
if hashlib.sha256(fixed.read_bytes()).hexdigest() != spec['fixed_problems_sha256']:
|
||||
raise ValueError('Fixed problems provenance mismatch')
|
||||
problem = json.loads(fixed.read_text())
|
||||
task = spec['task']
|
||||
expected = [(r['id'], r['answer_index']) for r in problem['test'] if r['task'] == task]
|
||||
data = json.loads(items.read_text())
|
||||
if set(data) != set(MODES) or not expected:
|
||||
raise ValueError('Unexpected test arms or empty selected split')
|
||||
correct = {}
|
||||
losses = {}
|
||||
for mode, rows in data.items():
|
||||
if [(r['id'], r['gold']) for r in rows] != expected:
|
||||
raise ValueError(f'{mode} result does not match the locked challenge')
|
||||
logits = np.array([r['logits'] for r in rows])
|
||||
gold = np.array([r['gold'] for r in rows])
|
||||
pred = np.array([r['pred'] for r in rows])
|
||||
nll = np.logaddexp.reduce(logits, 1) - logits[np.arange(len(rows)), gold]
|
||||
if (logits.shape != (len(rows), 4) or not np.isfinite(logits).all()
|
||||
or not np.array_equal(logits.argmax(1), pred)):
|
||||
raise ValueError(f'Invalid choice scores for {mode}')
|
||||
np.testing.assert_allclose(nll, [row['answer_nll'] for row in rows], atol=3e-6, rtol=2e-6)
|
||||
correct[mode], losses[mode] = pred == gold, nll
|
||||
metrics = {'selected_task': task, 'sites': spec['sites'], 'n': len(expected),
|
||||
'arms': {mode: {'correct': int(correct[mode].sum()),
|
||||
'answer_nll_4': float(losses[mode].mean()),
|
||||
'answer_nll_4_vs_direct': loss_delta(losses[mode], losses['direct']),
|
||||
**paired(correct['native'], correct['direct'], correct[mode])}
|
||||
for mode in MODES}}
|
||||
if perf:
|
||||
measured = json.loads(perf.read_text())
|
||||
med = {k: median(v) for k,v in measured['seconds'].items()}
|
||||
metrics['prefill'] = {'scope': measured['scope'], 'median_s': med,
|
||||
'lisa_median_ratio_to_native': med['lisa']/med['native']}
|
||||
if decode:
|
||||
measured = json.loads(decode.read_text())
|
||||
metrics['decode'] = {'scope': measured['scope'], 'sites': {}}
|
||||
for layer, raw in measured['sites'].items():
|
||||
times = {k: median(v) for k,v in raw['seconds_per_token'].items()}
|
||||
mem = raw['allocated_bytes']
|
||||
native = mem['native']['k'] + mem['native']['v']
|
||||
lisa = mem['lisa']['k'] + mem['lisa']['v']
|
||||
nn = raw['lisa_input_score_row_bytes']
|
||||
assert mem['lisa']['v'] == mem['native']['v'] and mem['lisa']['k'] < mem['native']['k']
|
||||
metrics['decode']['sites'][layer] = {
|
||||
'median_s_per_token': times, 'measured_kv_bytes': {'native': native, 'lisa': lisa},
|
||||
'lisa_upstream_score_row_bytes': nn, 'recipient_bytes_delta': lisa+nn-native,
|
||||
}
|
||||
if full_vocab:
|
||||
metrics['full_vocab'] = full_vocab_metrics(full_vocab, expected, spec['sites'], correct)
|
||||
return metrics
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
for name in ('fixed', 'selection', 'items', 'out'):
|
||||
parser.add_argument('--'+name, type=Path, required=True)
|
||||
parser.add_argument('--perf', type=Path)
|
||||
parser.add_argument('--decode', type=Path)
|
||||
parser.add_argument('--full-vocab', type=Path)
|
||||
a = parser.parse_args()
|
||||
report = audit(a.fixed, a.selection, a.items, a.perf, a.decode, a.full_vocab)
|
||||
write_json(a.out, report)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,183 @@
|
||||
"""Screen task difficulty and joint sharing schedules without opening test results."""
|
||||
import argparse
|
||||
import json
|
||||
import random
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
from tokenizers import Tokenizer
|
||||
|
||||
from crossqkv.core import QKVModel
|
||||
from crossqkv.lisa_pilot import batch
|
||||
from functional.model import PREFIX
|
||||
from functional.run import write_json
|
||||
from pilot.tensors import decode
|
||||
|
||||
MODES = ('native', 'direct_23', 'direct_19_23')
|
||||
SITES = (15, 19, 23)
|
||||
TASKS = ('lookup8', 'lookup16', 'latest8', 'arithmetic')
|
||||
SPLIT_SEEDS = {'screen': 415001, 'fit': 415002, 'validation': 415003, 'test': 415004}
|
||||
WORDS = ('amber birch cedar dune elm fern grove heath iris jade kelp larch '
|
||||
'maple nettle olive pine quartz reed slate thyme umber vine willow yew').split()
|
||||
|
||||
|
||||
def problems(split, per_task):
|
||||
rng = random.Random(SPLIT_SEEDS[split])
|
||||
rows = []
|
||||
for task in TASKS:
|
||||
answers = [i % 4 for i in range(per_task)]
|
||||
rng.shuffle(answers)
|
||||
for i, answer in enumerate(answers):
|
||||
if task == 'arithmetic':
|
||||
a, b = rng.sample(range(12, 99), 2)
|
||||
target = a + b
|
||||
distractors = [target - 10, target + 10, target + rng.choice((-1, 1))]
|
||||
question = f'What is {a} + {b}?'
|
||||
else:
|
||||
size = 16 if task == 'lookup16' else 8
|
||||
keys, vals = rng.sample(WORDS, size), rng.sample(range(10, 100), size)
|
||||
if task == 'latest8':
|
||||
first = rng.randrange(size - 1)
|
||||
last = rng.randrange(first + 1, size)
|
||||
keys[last] = keys[first]
|
||||
target = vals[last]
|
||||
remaining = [v for j, v in enumerate(vals) if j not in (first, last)]
|
||||
distractors = [vals[first], *rng.sample(remaining, 2)]
|
||||
key = keys[first]
|
||||
else:
|
||||
match = rng.randrange(size)
|
||||
target, key = vals[match], keys[match]
|
||||
distractors = rng.sample([v for v in vals if v != target], 3)
|
||||
table = '\n'.join(f'{k}: {v}' for k, v in zip(keys, vals))
|
||||
request = 'latest value' if task == 'latest8' else 'value'
|
||||
order = ' (oldest first)' if task == 'latest8' else ''
|
||||
question = f'Use the lookup table{order}.\n{table}\nWhich option is the {request} for {key}?'
|
||||
rng.shuffle(distractors)
|
||||
distractors.insert(answer, target)
|
||||
options = '\n'.join(f'{j+1}. {v}' for j, v in enumerate(distractors))
|
||||
prompt = f'{question}\n{options}\nAnswer with only the option number.\nAnswer:'
|
||||
rows.append({'id': f'{split}-{task}-{i:03}', 'task': task,
|
||||
'prompt': prompt, 'answer_index': answer})
|
||||
return rows
|
||||
|
||||
|
||||
class ScreeningModel(QKVModel):
|
||||
def normalization(self, h, name):
|
||||
if getattr(self, 'capture_prefix', False) and name == 'layers.19.input_layernorm':
|
||||
self.residual_19 = h
|
||||
return super().normalization(h, name)
|
||||
|
||||
def full_attention(self, h, layer, shared_p=None):
|
||||
if layer not in SITES:
|
||||
return super().full_attention(h, layer, shared_p)
|
||||
own = self.parts(h, layer, heads=False)
|
||||
p = own['p'].copy()
|
||||
if getattr(self, 'capture_prefix', False):
|
||||
if layer == 15:
|
||||
self.donor_15 = p
|
||||
return own['output'], p
|
||||
if layer == 19:
|
||||
p[self.chain] = self.prior[self.chain]
|
||||
elif layer == 23:
|
||||
p[self.shared] = self.prior[self.shared]
|
||||
self.prior = p
|
||||
repeats = self.config['num_attention_heads'] // self.config['num_key_value_heads']
|
||||
v = np.repeat(own['v'], repeats, axis=2)
|
||||
out = self.project(np.einsum('bhts,bshd->bthd', p, v), own['gate'], layer)
|
||||
return out, p
|
||||
|
||||
|
||||
def evaluate(model, tokenizer, examples):
|
||||
ids, lengths, labels = batch(tokenizer, examples)
|
||||
n = len(examples)
|
||||
model.chain = slice(2*n, 3*n)
|
||||
model.shared = slice(n, 3*n)
|
||||
if not getattr(model, 'reuse_prefix', False):
|
||||
h, _ = model.forward(np.tile(ids, (len(MODES), 1)))
|
||||
else:
|
||||
model.capture_prefix = True
|
||||
native, _ = model.forward(ids)
|
||||
model.capture_prefix = False
|
||||
h = np.concatenate([model.residual_19] * len(MODES))
|
||||
model.prior = np.concatenate([model.donor_15] * len(MODES))
|
||||
for layer, kind in enumerate(model.config['layer_types'][19:], 19):
|
||||
model.guard()
|
||||
p = f'layers.{layer}.'
|
||||
n_h = model.normalization(h, p+'input_layernorm')
|
||||
out = (model.full_attention(n_h, layer)[0] if kind == 'full_attention'
|
||||
else model.linear_attention(n_h, layer))
|
||||
h = h + out
|
||||
h = h + model.mlp(model.normalization(h, p+'post_attention_layernorm'), layer)
|
||||
h = model.normalization(h, 'norm')
|
||||
np.testing.assert_allclose(h[:n], native, atol=4e-5, rtol=3e-5)
|
||||
t = model.tensors[PREFIX + 'embed_tokens.weight']
|
||||
digit_weights = decode(t.raw.reshape(t.shape)[labels], t.dtype)
|
||||
t.evict()
|
||||
scores = [x[np.arange(n), np.asarray(lengths) - 1] @ digit_weights.T
|
||||
for x in np.split(h, len(MODES))]
|
||||
rows = []
|
||||
for i, ex in enumerate(examples):
|
||||
gold = ex['answer_index']
|
||||
item = {'id': ex['id'], 'task': ex['task'], 'gold': gold, 'scores': {}}
|
||||
for mode, logits in zip(MODES, scores):
|
||||
values = logits[i].astype(float)
|
||||
item['scores'][mode] = {'pred': int(values.argmax()), 'logits': values.tolist(),
|
||||
'nll': float(np.logaddexp.reduce(values) - values[gold])}
|
||||
rows.append(item)
|
||||
return rows
|
||||
|
||||
|
||||
def summarize(rows):
|
||||
table = {}
|
||||
for task in TASKS:
|
||||
group = [r for r in rows if r['task'] == task]
|
||||
if not group:
|
||||
continue
|
||||
table[task] = {}
|
||||
for mode in MODES:
|
||||
table[task][mode] = {
|
||||
'n': len(group),
|
||||
'correct': sum(r['scores'][mode]['pred'] == r['gold'] for r in group),
|
||||
'native_wins_lost': sum(r['scores']['native']['pred'] == r['gold']
|
||||
and r['scores'][mode]['pred'] != r['gold'] for r in group),
|
||||
'nll': float(np.mean([r['scores'][mode]['nll'] for r in group])),
|
||||
}
|
||||
return table
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--source', required=True, type=Path)
|
||||
parser.add_argument('--out', required=True, type=Path)
|
||||
parser.add_argument('--resume', action='store_true', help='Keep completed batches')
|
||||
parser.add_argument('--reuse-prefix', action='store_true', help='Run layers 0–18 once per input')
|
||||
args = parser.parse_args()
|
||||
args.out.mkdir(exist_ok=args.resume)
|
||||
model = ScreeningModel(args.source/'weights',
|
||||
json.loads((args.source/'model_config.json').read_text()), seconds=3600)
|
||||
if any(model.config['layer_types'][ix] != 'full_attention' for ix in SITES):
|
||||
raise ValueError('Scheduled layers must all have full attention')
|
||||
model.reuse_prefix = args.reuse_prefix
|
||||
tok = Tokenizer.from_file(str(args.source/'tokenizer.json'))
|
||||
data = {split: problems(split, n) for split, n in
|
||||
[('screen', 8), ('fit', 12), ('validation', 12), ('test', 32)]}
|
||||
prompts = [r['prompt'] for xs in data.values() for r in xs]
|
||||
if len(set(prompts)) != len(prompts):
|
||||
raise ValueError('Prompt sets overlap')
|
||||
manifest = args.out/'fixed-problems.json'
|
||||
collected = args.out/'screen-rows.json'
|
||||
if args.resume and manifest.exists() and json.loads(manifest.read_text()) != data:
|
||||
raise ValueError('Fixed prompts changed')
|
||||
write_json(manifest, data)
|
||||
rows = json.loads(collected.read_text()) if args.resume and collected.exists() else []
|
||||
if len(rows) % 4 or [r['id'] for r in rows] != [r['id'] for r in data['screen'][:len(rows)]]:
|
||||
raise ValueError('Existing screen does not match the fixed prompt sequence')
|
||||
for i in range(len(rows), len(data['screen']), 4):
|
||||
rows.extend(evaluate(model, tok, data['screen'][i:i+4]))
|
||||
write_json(args.out/'screen-rows.json', rows)
|
||||
print('screen', len(rows), flush=True)
|
||||
write_json(args.out/'screen-summary.json', summarize(rows))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,221 @@
|
||||
"""Freeze numeric tasks and screen the effect of sharing on complete answers."""
|
||||
import argparse
|
||||
from hashlib import sha256
|
||||
import json
|
||||
from pathlib import Path
|
||||
import random
|
||||
import re
|
||||
|
||||
import torch
|
||||
from tokenizers import Tokenizer
|
||||
|
||||
from crossqkv.lisa_effect_screen import WORDS
|
||||
from crossqkv.lisa_generate import GenerationDecoder, generate
|
||||
from crossqkv.lisa_tail import TorchTail
|
||||
from functional.model import StreamingLM
|
||||
from functional.run import write_json
|
||||
|
||||
|
||||
TASKS = ('lookup', 'latest', 'addition', 'count')
|
||||
SEEDS = {'screen': 621001, 'fit': 621002, 'validation': 621003, 'test': 621004}
|
||||
COUNTS = {'screen': 8, 'fit': 24, 'validation': 8, 'test': 32}
|
||||
SCHEDULES = {'native': (), 'direct_3': (15, 19, 23),
|
||||
'direct_4': (11, 15, 19, 23), 'direct_5': (7, 11, 15, 19, 23)}
|
||||
STOP_TEXT = ('<|im_end|>', '<|endoftext|>')
|
||||
MAX_NEW_TOKENS = 24
|
||||
|
||||
|
||||
def fixed_problems():
|
||||
output = {}
|
||||
for split, seed in SEEDS.items():
|
||||
rng = random.Random(seed)
|
||||
rows = []
|
||||
for task in TASKS:
|
||||
for i in range(COUNTS[split]):
|
||||
if task in ('lookup', 'latest'):
|
||||
keys = rng.sample(WORDS, 12)
|
||||
values = rng.sample(range(20, 100), 12)
|
||||
pos = rng.randrange(len(keys))
|
||||
key = keys[pos]
|
||||
if task == 'latest':
|
||||
later = rng.randrange(1, len(keys))
|
||||
earlier = rng.randrange(later)
|
||||
keys[earlier] = keys[later]
|
||||
pos, key = later, keys[later]
|
||||
schedule = ', '.join(f'{k}={v}' for k, v in zip(keys, values))
|
||||
descriptor = 'last recorded' if task == 'latest' else 'recorded'
|
||||
question = f'Records in time order: {schedule}.\nWhat is the {descriptor} number for {key}?'
|
||||
answer = values[pos]
|
||||
elif task == 'addition':
|
||||
a, b = sorted((rng.randint(20, 89), rng.randint(20, 89)))
|
||||
question = f'What is {a} plus {b}?'
|
||||
answer = a + b
|
||||
else:
|
||||
first, second = rng.sample(WORDS, 2)
|
||||
answer = rng.randint(10, 15)
|
||||
values = [first] * answer + [second] * rng.randint(3, 9)
|
||||
rng.shuffle(values)
|
||||
question = f"Items: {', '.join(values)}.\nHow many items are exactly '{first}'?"
|
||||
rows.append({'id': f'{split}-{task}-{i:03}', 'task': task,
|
||||
'question': question, 'answer': answer})
|
||||
output[split] = rows
|
||||
# Arithmetic questions can repeat across independently seeded splits.
|
||||
# Keep the first generated occurrence and fill duplicates with new disjoint sums.
|
||||
used = set()
|
||||
replacement = random.Random(621005)
|
||||
for rows in output.values():
|
||||
for row in rows:
|
||||
while row['task'] == 'addition' and row['question'] in used:
|
||||
a, b = sorted((replacement.randint(20, 89), replacement.randint(20, 89)))
|
||||
row.update(question=f'What is {a} plus {b}?', answer=a+b)
|
||||
if row['question'] in used:
|
||||
raise ValueError('Prompt repeated across the frozen set')
|
||||
used.add(row['question'])
|
||||
return output
|
||||
|
||||
|
||||
def prompt(question):
|
||||
return ('<|im_start|>user\n' + question + '\nReply with the integer and no other text.'
|
||||
'<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n')
|
||||
|
||||
|
||||
def final_integer(text):
|
||||
# Only completed reasoning prefixes precede an answer.
|
||||
text = re.sub(r'\A\s*(?:<think>.*?</think>\s*)+', '', text, flags=re.S).strip()
|
||||
if '<think>' in text or '</think>' in text:
|
||||
return None
|
||||
match = re.fullmatch(r'(?:[Ff]inal answer:\s*|[Aa]nswer:\s*)?([+-]?\d+)\.?', text)
|
||||
if not match:
|
||||
match = re.search(r'(?:^|\n)\s*(?:[Ff]inal answer|[Aa]nswer):\s*([+-]?\d+)\.?\s*\Z', text)
|
||||
return int(match[1]) if match else None
|
||||
|
||||
|
||||
def grade(tokenizer, tokens, stop, expected):
|
||||
whole = tokenizer.decode(tokens, skip_special_tokens=False)
|
||||
body = tokenizer.decode(tokens[:-1] if stop == 'eos' else tokens,
|
||||
skip_special_tokens=False)
|
||||
value = final_integer(body) if stop == 'eos' else None
|
||||
return {'tokens': tokens, 'response': whole, 'stop': stop, 'answer': value,
|
||||
'correct': value == expected}
|
||||
|
||||
|
||||
def evaluate(model, tokenizer, examples, arms, adapters=None):
|
||||
stop_ids = {tokenizer.token_to_id(text) for text in STOP_TEXT}
|
||||
if None in stop_ids or len(stop_ids) != len(STOP_TEXT):
|
||||
raise ValueError('Unexpected tokenizer stop tokens')
|
||||
ids = [tokenizer.encode(prompt(x['question']), add_special_tokens=False).ids for x in examples]
|
||||
expanded = [x for x in ids for _ in arms]
|
||||
schedules = list(arms.values()) * len(examples)
|
||||
predictions = iter(generate(model, expanded, schedules, stop_ids, MAX_NEW_TOKENS, adapters))
|
||||
return [{'id': x['id'], 'task': x['task'], 'gold': x['answer'],
|
||||
'arms': {mode: grade(tokenizer, *next(predictions), x['answer']) for mode in arms}}
|
||||
for x in examples]
|
||||
|
||||
|
||||
def summarize(rows):
|
||||
results = {}
|
||||
for task in TASKS:
|
||||
group = [row for row in rows if row['task'] == task]
|
||||
results[task] = {}
|
||||
for name in SCHEDULES:
|
||||
original_correct = lambda row: row['arms']['native']['correct']
|
||||
produced_wrong = lambda row: row['arms'][name]['answer'] is not None and not row['arms'][name]['correct']
|
||||
results[task][name] = {
|
||||
'n': len(group),
|
||||
'correct': sum(row['arms'][name]['correct'] for row in group),
|
||||
'unscored': sum(row['arms'][name]['answer'] is None for row in group),
|
||||
'native_correct_to_wrong_integer': [
|
||||
row['id'] for row in group if original_correct(row) and produced_wrong(row)],
|
||||
}
|
||||
return results
|
||||
|
||||
|
||||
def choose(summary):
|
||||
options = []
|
||||
for task, arms in summary.items():
|
||||
if arms['native']['correct'] >= 6:
|
||||
for arm in ('direct_3', 'direct_4', 'direct_5'):
|
||||
losses = arms[arm]['native_correct_to_wrong_integer']
|
||||
if len(losses) >= 2:
|
||||
options.append((len(losses), arms['native']['correct'],
|
||||
len(SCHEDULES[arm]), task, arm))
|
||||
if not options:
|
||||
return None
|
||||
_, _, _, task, arm = max(options)
|
||||
return {'task': task, 'arm': arm, 'recipients': list(SCHEDULES[arm])}
|
||||
|
||||
|
||||
def fingerprint(path):
|
||||
return sha256(path.read_bytes()).hexdigest()
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--source', required=True, type=Path)
|
||||
parser.add_argument('--out', required=True, type=Path)
|
||||
parser.add_argument('--seconds', default=21600, type=int)
|
||||
parser.add_argument('--batch-prompts', default=2, type=int, choices=(1, 2))
|
||||
parser.add_argument('--execution-batch-prompts', type=int, choices=(1, 2),
|
||||
help='Use a different execution batch on resume after replaying completed rows')
|
||||
parser.add_argument('--preflight', action='store_true')
|
||||
args = parser.parse_args()
|
||||
torch.set_num_threads(1)
|
||||
args.out.mkdir(exist_ok=True)
|
||||
files = {name: fingerprint(args.source/name) for name in
|
||||
('manifest.json', 'model_config.json', 'tokenizer.json')}
|
||||
protocol = {'weights': files, 'schedules': SCHEDULES, 'cap': MAX_NEW_TOKENS,
|
||||
'stops': STOP_TEXT, 'batch_prompts': args.batch_prompts,
|
||||
'decode': 'full vocabulary greedy, closed thinking prefix'}
|
||||
manifest = args.out/'frozen.json'
|
||||
frozen = {'protocol': protocol, 'problems': fixed_problems()}
|
||||
frozen = json.loads(json.dumps(frozen))
|
||||
if manifest.exists() and json.loads(manifest.read_text()) != frozen:
|
||||
raise ValueError('Frozen protocol or prompts changed')
|
||||
write_json(manifest, frozen)
|
||||
model = StreamingLM(args.source/'weights', json.loads((args.source/'model_config.json').read_text()),
|
||||
seconds=args.seconds, process_swap_limit_kib=None)
|
||||
tokenizer = Tokenizer.from_file(str(args.source/'tokenizer.json'))
|
||||
examples = frozen['problems']['screen']
|
||||
if args.preflight:
|
||||
ids = torch.tensor([tokenizer.encode(prompt(examples[0]['question']),
|
||||
add_special_tokens=False).ids])
|
||||
hidden = torch.from_numpy(model.embedding(ids.numpy()))
|
||||
with torch.no_grad():
|
||||
expected, _ = TorchTail(model, 0)(hidden, None, torch.tensor([ids.shape[1]]),
|
||||
'native', ())
|
||||
decoder = GenerationDecoder(model, [()], [0])
|
||||
decoder.advance(ids[:, :-2])
|
||||
actual = decoder.advance(ids[:, -2:])
|
||||
ref = expected[:, -2:]
|
||||
torch.testing.assert_close(actual, ref, atol=8e-5, rtol=7e-5)
|
||||
write_json(args.out/'preflight.json', {'prompt_id': examples[0]['id'],
|
||||
'prompt_tokens': ids.shape[1], 'tail_hidden_max_abs': float((actual-ref).abs().max())})
|
||||
return
|
||||
path = args.out/'screen-rows.json'
|
||||
rows = json.loads(path.read_text()) if path.exists() else []
|
||||
if [r['id'] for r in rows] != [x['id'] for x in examples[:len(rows)]]:
|
||||
raise ValueError('Existing screen results do not match frozen prompts')
|
||||
batch = args.execution_batch_prompts or args.batch_prompts
|
||||
if batch != args.batch_prompts:
|
||||
if len(rows) < batch:
|
||||
raise ValueError('The alternate batch requires enough already evaluated prompts for replay')
|
||||
replay = evaluate(model, tokenizer, examples[:batch], SCHEDULES)
|
||||
if replay != rows[:batch]:
|
||||
raise ValueError('Alternate batch changed the first completed token streams')
|
||||
write_json(args.out/'execution-batch-replay.json',
|
||||
{'frozen_sha256': fingerprint(manifest), 'batch_prompts': batch,
|
||||
'matched_rows': [row['id'] for row in replay]})
|
||||
print('validated execution batch', batch, flush=True)
|
||||
for start in range(len(rows), len(examples), batch):
|
||||
rows.extend(evaluate(model, tokenizer, examples[start:start+batch], SCHEDULES))
|
||||
write_json(path, rows)
|
||||
print('screen complete', len(rows), '/', len(examples), flush=True)
|
||||
summary = summarize(rows)
|
||||
write_json(args.out/'screen-summary.json', summary)
|
||||
write_json(args.out/'selection.json', {'frozen_sha256': fingerprint(manifest),
|
||||
'screen_sha256': fingerprint(path),
|
||||
'chosen': choose(summary)})
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,223 @@
|
||||
"""Fit LiSA on a development-selected schedule, then evaluate fresh continuations."""
|
||||
import argparse
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
from tokenizers import Tokenizer
|
||||
|
||||
from crossqkv.lisa_effect_audit import paired
|
||||
from crossqkv.lisa_full_answer import (SCHEDULES, STOP_TEXT, choose, evaluate, fingerprint,
|
||||
prompt, summarize)
|
||||
from crossqkv.lisa_tail import TorchTail, weight_chunks
|
||||
from crossqkv.lisa_train import LearnableSharingAttention, huber_distillation, language_model_loss
|
||||
from functional.model import PREFIX, StreamingLM
|
||||
from functional.run import write_json
|
||||
|
||||
|
||||
class FitCapture(TorchTail):
|
||||
def norm(self, x, name, centered=True):
|
||||
if name == f'layers.{self.sites[0]}.input_layernorm':
|
||||
self.residual = x
|
||||
return super().norm(x, name, centered)
|
||||
|
||||
|
||||
def load_locked(source, screen):
|
||||
fixed = screen/'frozen.json'
|
||||
rows = screen/'screen-rows.json'
|
||||
chosen = json.loads((screen/'selection.json').read_text())
|
||||
if (chosen['frozen_sha256'] != fingerprint(fixed)
|
||||
or chosen['screen_sha256'] != fingerprint(rows)):
|
||||
raise ValueError('Locked screening hashes do not match')
|
||||
manifest = json.loads(fixed.read_text())
|
||||
screen_rows = json.loads(rows.read_text())
|
||||
expected = [(x['id'], x['task'], x['answer']) for x in manifest['problems']['screen']]
|
||||
if [(x['id'], x['task'], x['gold']) for x in screen_rows] != expected:
|
||||
raise ValueError('Screening did not evaluate the frozen development set')
|
||||
expected_selection = choose(summarize(screen_rows))
|
||||
if expected_selection is None or chosen['chosen'] != expected_selection:
|
||||
raise ValueError('Development screen did not produce a qualifying schedule')
|
||||
for name, digest in manifest['protocol']['weights'].items():
|
||||
if fingerprint(source/name) != digest:
|
||||
raise ValueError(f'Model input {name} changed')
|
||||
return chosen, manifest
|
||||
|
||||
|
||||
def verified_fit_captures(source, fit):
|
||||
"""Verify the frozen fit inputs and return their archives by question ID."""
|
||||
captures = source/'fit-capture'
|
||||
receipt = source/'verified-fit-capture.json'
|
||||
if fingerprint(receipt) != '682bc035a5bed9f9245f589cacf3e9616300e8bf5e85d3743b1264a56360fa55':
|
||||
raise ValueError('Capture receipt mismatch')
|
||||
records = json.loads(receipt.read_text())['records']
|
||||
if ([r['id'] for r in records] != [r['id'] for r in fit] or
|
||||
sorted(x.name for x in captures.glob('*.npz')) != [r['file'] for r in records]):
|
||||
raise ValueError('Unexpected capture set')
|
||||
for row in records:
|
||||
if fingerprint(captures/row['file']) != row['sha256']:
|
||||
raise ValueError('Fit capture mismatch')
|
||||
return {r['id']: captures/r['file'] for r in records}
|
||||
|
||||
|
||||
@torch.no_grad()
|
||||
def capture(model, tokenizer, fit_examples, directory):
|
||||
directory.mkdir(exist_ok=True)
|
||||
teacher = FitCapture(model, 0)
|
||||
teacher.sites = model.sites
|
||||
for i, row in enumerate(fit_examples):
|
||||
path = directory/f'{i:03}.npz'
|
||||
if path.exists():
|
||||
continue
|
||||
text = prompt(row['question'])
|
||||
base = tokenizer.encode(text, add_special_tokens=False).ids
|
||||
complete = tokenizer.encode(text + str(row['answer']) + STOP_TEXT[0],
|
||||
add_special_tokens=False).ids
|
||||
if complete[:len(base)] != base or len(complete) <= len(base):
|
||||
raise ValueError('Answer did not tokenize as an extension of the frozen prompt')
|
||||
ids = np.array([complete])
|
||||
model.guard()
|
||||
hidden = torch.from_numpy(model.embedding(ids))
|
||||
_, side = teacher(hidden, None, torch.tensor([len(complete)]), 'native', ())
|
||||
pending = path.with_suffix('.tmp.npz')
|
||||
np.savez(pending, ids=ids, start=[len(base)], residual=teacher.residual.numpy(),
|
||||
donor=side[model.sites[0]-4][0].numpy(),
|
||||
teacher=np.stack([side[i][0].numpy() for i in model.sites]))
|
||||
pending.replace(path)
|
||||
print('fit capture', i+1, '/', len(fit_examples), flush=True)
|
||||
|
||||
|
||||
def checkpoint(path, obj):
|
||||
pending = path.with_suffix('.tmp')
|
||||
torch.save(obj, pending)
|
||||
pending.replace(path)
|
||||
|
||||
|
||||
def train(model, tokenizer, out, split, epochs, rank, *, adapters=None, captures=None):
|
||||
if adapters is None:
|
||||
c = model.config
|
||||
rope = c['rope_parameters']
|
||||
adapters = {i: LearnableSharingAttention(c['hidden_size'], c['num_attention_heads'],
|
||||
c['num_key_value_heads'], rank, rope['rope_theta'], rope['partial_rotary_factor'],
|
||||
bias=c.get('attention_bias', False)) for i in model.sites}
|
||||
tail = TorchTail(model, model.sites[0], adapters)
|
||||
optim = torch.optim.AdamW(tail.parameters(), lr=.0003, weight_decay=.1)
|
||||
last = out/'resume.pt'
|
||||
selected = out/'lisa.pt'
|
||||
state = {'epoch': 0, 'steps': [], 'trace': [], 'best_correct': -1}
|
||||
if last.exists():
|
||||
state = torch.load(last, weights_only=True, map_location='cpu')
|
||||
tail.adapters.load_state_dict(state['parameters'])
|
||||
optim.load_state_dict(state['optimizer'])
|
||||
|
||||
embedding = model.tensors[PREFIX+'embed_tokens.weight']
|
||||
|
||||
def vocab():
|
||||
start = 0
|
||||
for w in weight_chunks(embedding, 0, embedding.shape[0], rows=1024):
|
||||
yield start, w
|
||||
start += len(w)
|
||||
|
||||
paths = sorted((captures or out/'fit-capture').glob('*.npz'))
|
||||
for epoch in range(state['epoch'], epochs):
|
||||
for path in paths[len(state['steps']):]:
|
||||
with np.load(path, allow_pickle=False) as entry:
|
||||
b = {key: torch.from_numpy(entry[key]) for key in entry.files}
|
||||
lengths = torch.tensor([b['ids'].shape[1]])
|
||||
optim.zero_grad(set_to_none=True)
|
||||
h, side = tail(b['residual'], b['donor'], lengths, 'lisa', model.sites)
|
||||
kd = torch.stack([huber_distillation(side[i][0], t, lengths)
|
||||
for i, t in zip(model.sites, b['teacher'])]).mean()
|
||||
ce = language_model_loss(h, b['ids'], lengths, vocab, completion_starts=b['start'])
|
||||
loss = .25*kd + .75*ce
|
||||
loss.backward()
|
||||
if any(p.grad is None or not torch.isfinite(p.grad).all() for p in tail.parameters()):
|
||||
raise FloatingPointError('Nonfinite LiSA gradient')
|
||||
optim.step()
|
||||
state['steps'].append({'capture': path.name, 'huber': float(kd.detach()),
|
||||
'completion_ce': float(ce.detach())})
|
||||
checkpoint(last, {**state, 'parameters': tail.adapters.state_dict(),
|
||||
'optimizer': optim.state_dict()})
|
||||
print('fit epoch', epoch+1, 'step', len(state['steps']), '/', len(paths), flush=True)
|
||||
val = []
|
||||
for start in range(0, len(split['validation']), 2):
|
||||
val.extend(evaluate(model, tokenizer, split['validation'][start:start+2],
|
||||
{'lisa': model.sites}, adapters))
|
||||
correct = sum(x['arms']['lisa']['correct'] for x in val)
|
||||
if correct > state['best_correct']:
|
||||
state['best_correct'] = correct
|
||||
state['best_epoch'] = epoch+1
|
||||
state['best_parameters'] = {
|
||||
name: param.detach().clone() for name, param in tail.adapters.state_dict().items()
|
||||
}
|
||||
state['trace'].append({'epoch': epoch+1, 'steps': state['steps'], 'validation': val})
|
||||
state['steps'] = []
|
||||
state['epoch'] = epoch+1
|
||||
checkpoint(last, {**state, 'parameters': tail.adapters.state_dict(),
|
||||
'optimizer': optim.state_dict()})
|
||||
write_json(out/'trace.json', {'selected_epoch': state['best_epoch'], 'epochs': state['trace']})
|
||||
checkpoint(selected, state['best_parameters'])
|
||||
tail.adapters.load_state_dict(state['best_parameters'])
|
||||
return adapters
|
||||
|
||||
|
||||
def audit(rows):
|
||||
correct = {name: np.array([r['arms'][name]['correct'] for r in rows])
|
||||
for name in ('native', 'direct', 'lisa')}
|
||||
bad_value = [r for r in rows if r['arms']['native']['correct']
|
||||
and r['arms']['direct']['answer'] is not None and not r['arms']['direct']['correct']]
|
||||
return {'n': len(rows), 'correct': {name: int(x.sum()) for name, x in correct.items()},
|
||||
'substantive_loss_ids': [r['id'] for r in bad_value],
|
||||
'substantive_rescued_ids': [r['id'] for r in bad_value if r['arms']['lisa']['correct']],
|
||||
'unscored': {name: sum(r['arms'][name]['answer'] is None for r in rows) for name in correct},
|
||||
**paired(correct['native'], correct['direct'], correct['lisa'])}
|
||||
|
||||
|
||||
def main():
|
||||
p = argparse.ArgumentParser(description=__doc__)
|
||||
for path in ('source', 'screen', 'out'):
|
||||
p.add_argument('--'+path, type=Path, required=True)
|
||||
p.add_argument('--epochs', type=int, default=2)
|
||||
args = p.parse_args()
|
||||
if args.epochs < 1:
|
||||
p.error('--epochs must be positive')
|
||||
torch.set_num_threads(1)
|
||||
torch.manual_seed(621011)
|
||||
locked, manifest = load_locked(args.source, args.screen)
|
||||
selection = locked['chosen']
|
||||
sites = tuple(selection['recipients'])
|
||||
if sites != SCHEDULES[selection['arm']]:
|
||||
raise ValueError('Unexpected selected schedule')
|
||||
spec = {'screen': locked, 'epochs': args.epochs, 'rank': 40, 'seed': 621011,
|
||||
'objective': '0.25 teacher attention Huber + 0.75 full-vocabulary completion CE'}
|
||||
args.out.mkdir(exist_ok=True)
|
||||
run = args.out/'train-spec.json'
|
||||
if run.exists() and json.loads(run.read_text()) != spec:
|
||||
raise ValueError('Cannot resume with a different experiment definition')
|
||||
write_json(run, spec)
|
||||
tasks = {name: [r for r in rows if r['task'] == selection['task']]
|
||||
for name, rows in manifest['problems'].items()}
|
||||
model = StreamingLM(args.source/'weights', json.loads((args.source/'model_config.json').read_text()),
|
||||
seconds=86400, process_swap_limit_kib=None)
|
||||
model.sites = sites
|
||||
tokenizer = Tokenizer.from_file(str(args.source/'tokenizer.json'))
|
||||
capture(model, tokenizer, tasks['fit'], args.out/'fit-capture')
|
||||
adapters = train(model, tokenizer, args.out, tasks, args.epochs, spec['rank'])
|
||||
output = args.out/'test-items.json'
|
||||
rows = json.loads(output.read_text()) if output.exists() else []
|
||||
if [r['id'] for r in rows] != [x['id'] for x in tasks['test'][:len(rows)]]:
|
||||
raise ValueError('Test continuation does not match the frozen rows')
|
||||
for start in range(len(rows), len(tasks['test']), 2):
|
||||
batch = tasks['test'][start:start+2]
|
||||
base = evaluate(model, tokenizer, batch, {'native': (), 'direct': sites})
|
||||
lisa = evaluate(model, tokenizer, batch, {'lisa': sites}, adapters)
|
||||
for x, y in zip(base, lisa):
|
||||
x['arms'].update(y['arms'])
|
||||
rows.extend(base)
|
||||
write_json(output, rows)
|
||||
print('test complete', len(rows), '/', len(tasks['test']), flush=True)
|
||||
write_json(args.out/'test-audit.json', audit(rows))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,73 @@
|
||||
"""Reconstruct complete-answer scores from the saved token streams."""
|
||||
import argparse
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
from tokenizers import Tokenizer
|
||||
|
||||
from crossqkv.lisa_full_answer import SCHEDULES, fingerprint, grade
|
||||
from crossqkv.lisa_full_answer_train import audit
|
||||
from functional.run import write_json
|
||||
|
||||
|
||||
def verify(tokenizer, protocol, expected, rows, arms, allow_prefix=False):
|
||||
"""Validate each recorded model answer against its frozen prompt and token IDs."""
|
||||
if not rows or len(rows) > len(expected) or (not allow_prefix and len(rows) != len(expected)):
|
||||
raise ValueError('Unexpected number of evaluated items')
|
||||
stop_ids = {tokenizer.token_to_id(text) for text in protocol['stops']}
|
||||
if None in stop_ids:
|
||||
raise ValueError('Missing stop token in the frozen tokenizer')
|
||||
for item, row in zip(expected, rows):
|
||||
if (row['id'], row['task'], row['gold']) != (item['id'], item['task'], item['answer']):
|
||||
raise ValueError(f"Unexpected row for {item['id']}")
|
||||
if set(row['arms']) != set(arms):
|
||||
raise ValueError(f"Unexpected arms for {item['id']}")
|
||||
for arm in arms:
|
||||
stored = row['arms'][arm]
|
||||
tokens = stored['tokens']
|
||||
if (not 0 < len(tokens) <= protocol['cap']
|
||||
or any(type(token) is not int or tokenizer.id_to_token(token) is None
|
||||
for token in tokens)
|
||||
or any(token in stop_ids for token in tokens[:-1])):
|
||||
raise ValueError(f"Invalid generated token stream for {item['id']} / {arm}")
|
||||
ended = tokens[-1] in stop_ids
|
||||
if not ended and len(tokens) != protocol['cap']:
|
||||
raise ValueError(f"Generation ended before a stop or the cap for {item['id']} / {arm}")
|
||||
score = grade(tokenizer, tokens, 'eos' if ended else 'max_new_tokens', item['answer'])
|
||||
if stored != score:
|
||||
raise ValueError(f"Archived score does not match the tokens for {item['id']} / {arm}")
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
for name in ('tokenizer', 'frozen', 'rows', 'out'):
|
||||
parser.add_argument('--'+name, required=True, type=Path)
|
||||
parser.add_argument('--selection', type=Path, help='Verify the selected task on the test split')
|
||||
parser.add_argument('--allow-screen-prefix', action='store_true')
|
||||
args = parser.parse_args()
|
||||
if args.selection and args.allow_screen_prefix:
|
||||
parser.error('Test verification requires all frozen test rows')
|
||||
frozen = json.loads(args.frozen.read_bytes())
|
||||
protocol = frozen['protocol']
|
||||
if fingerprint(args.tokenizer) != protocol['weights']['tokenizer.json']:
|
||||
raise ValueError('Tokenizer differs from the frozen experiment')
|
||||
rows = json.loads(args.rows.read_bytes())
|
||||
tokenizer = Tokenizer.from_file(str(args.tokenizer))
|
||||
report = {'frozen_sha256': fingerprint(args.frozen), 'rows_sha256': fingerprint(args.rows),
|
||||
'rows_verified': len(rows)}
|
||||
if args.selection:
|
||||
chosen = json.loads(args.selection.read_bytes())
|
||||
if chosen['frozen_sha256'] != report['frozen_sha256']:
|
||||
raise ValueError('Selection points to a different frozen manifest')
|
||||
expected = [item for item in frozen['problems']['test']
|
||||
if item['task'] == chosen['chosen']['task']]
|
||||
verify(tokenizer, protocol, expected, rows, ('native', 'direct', 'lisa'))
|
||||
report['final_answer_audit'] = audit(rows)
|
||||
else:
|
||||
verify(tokenizer, protocol, frozen['problems']['screen'], rows, SCHEDULES,
|
||||
allow_prefix=args.allow_screen_prefix)
|
||||
write_json(args.out, report)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,135 @@
|
||||
"""Cached autoregressive Qwen text generation for the LiSA comparisons."""
|
||||
import math
|
||||
|
||||
import torch
|
||||
from torch.nn import functional as F
|
||||
|
||||
from crossqkv.lisa_tail import TorchTail, rotate, weight_chunks
|
||||
from functional.model import PREFIX
|
||||
|
||||
|
||||
class GenerationDecoder(TorchTail):
|
||||
"""Share the previous full-attention layer's actual scores per batch lane."""
|
||||
|
||||
def __init__(self, source, schedules, padding, adapters=None):
|
||||
super().__init__(source, 0, adapters)
|
||||
full = [i for i, kind in enumerate(self.c['layer_types']) if kind == 'full_attention']
|
||||
if (len(schedules) != len(padding) or not schedules
|
||||
or any(set(sites) - set(full[1:]) for sites in schedules)):
|
||||
raise ValueError('Recipients need an earlier full-attention layer')
|
||||
if self.adapters and any(tuple(sites) != tuple(map(int, self.adapters)) for sites in schedules):
|
||||
raise ValueError('LiSA decoding requires one shared schedule for the batch')
|
||||
self.padding = torch.tensor(padding)
|
||||
self.share = {i: torch.tensor([i in sites for sites in schedules])[:, None, None, None]
|
||||
for i in set().union(*schedules)}
|
||||
self.position = 0
|
||||
self.states = {}
|
||||
|
||||
def attention_chunk(self, h, layer, positions, allowed, donor):
|
||||
heads, kv, dim = (self.c[k] for k in
|
||||
('num_attention_heads', 'num_key_value_heads', 'head_dim'))
|
||||
p = f'layers.{layer}.self_attn.'
|
||||
adapter = self.adapters[str(layer)] if str(layer) in self.adapters else None
|
||||
if adapter is None:
|
||||
q, gate = self.linear(h, p+'q_proj').unflatten(-1, (heads, 2*dim)).chunk(2, -1)
|
||||
k = self.linear(h, p+'k_proj').unflatten(-1, (kv, dim))
|
||||
rope = self.c['rope_parameters']
|
||||
q = rotate(self.norm(q, p+'q_norm'), rope['rope_theta'],
|
||||
rope['partial_rotary_factor'], positions)
|
||||
k = rotate(self.norm(k, p+'k_norm'), rope['rope_theta'],
|
||||
rope['partial_rotary_factor'], positions)
|
||||
else:
|
||||
gate = self.gate_only(h, p)
|
||||
q = adapter.rotate(adapter.q_proj(h).unflatten(-1, (heads, adapter.rank)), positions)
|
||||
k = adapter.rotate(adapter.k_proj(h).unflatten(-1, (kv, adapter.rank)), positions)
|
||||
v = self.linear(h, p+'v_proj').unflatten(-1, (kv, dim))
|
||||
if layer in self.states:
|
||||
prior_k, prior_v = self.states[layer]
|
||||
k = torch.cat((prior_k, k), dim=1)
|
||||
v = torch.cat((prior_v, v), dim=1)
|
||||
self.states[layer] = k, v
|
||||
repeats = heads // kv
|
||||
scores = torch.einsum('bthd,bshd->bhts', q, k.repeat_interleave(repeats, 2))
|
||||
scores = scores / math.sqrt(q.shape[-1])
|
||||
if adapter is not None:
|
||||
both = torch.cat((scores, donor), dim=1).permute(0, 2, 3, 1)
|
||||
scores = adapter.fuse(both).permute(0, 3, 1, 2)
|
||||
elif layer in self.share:
|
||||
scores = torch.where(self.share[layer], donor, scores)
|
||||
scores, outgoing = self.score_paths(h, layer, positions, scores)
|
||||
weights = scores.masked_fill(~allowed, -torch.inf).softmax(dim=-1)
|
||||
context = torch.einsum('bhts,bshd->bthd', weights, v.repeat_interleave(repeats, 2))
|
||||
return self.linear((context * gate.sigmoid()).flatten(-2), p+'o_proj'), outgoing
|
||||
|
||||
def score_paths(self, h, layer, positions, scores):
|
||||
return scores, scores
|
||||
|
||||
@torch.no_grad()
|
||||
def advance(self, ids):
|
||||
"""Consume a prompt or continuation and return the final-normalized states."""
|
||||
stop = self.position + ids.shape[1]
|
||||
queries = torch.arange(self.position, stop)
|
||||
keys = torch.arange(stop)
|
||||
positions = (queries[None, :] - self.padding[:, None]).clamp_min(0)
|
||||
q_valid = queries[None, :] >= self.padding[:, None]
|
||||
k_valid = keys[None, :] >= self.padding[:, None]
|
||||
allowed = (queries[:, None] >= keys)[None, None] & (
|
||||
k_valid[:, None, None, :] | ~q_valid[:, None, :, None])
|
||||
h = torch.from_numpy(self.source.embedding(ids.numpy())) * q_valid[..., None]
|
||||
donor = None
|
||||
trim = getattr(self.source, 'malloc_trim', None)
|
||||
for layer, kind in enumerate(self.c['layer_types']):
|
||||
if hasattr(self.source, 'guard'):
|
||||
self.source.guard()
|
||||
p = f'layers.{layer}.'
|
||||
n = self.norm(h, p+'input_layernorm')
|
||||
if kind == 'full_attention':
|
||||
out, donor = self.attention_chunk(n, layer, positions, allowed, donor)
|
||||
else:
|
||||
out, self.states[layer] = self.linear_attention_chunk(n, layer, self.states.get(layer))
|
||||
h = h + out
|
||||
n = self.norm(h, p+'post_attention_layernorm')
|
||||
activation = F.silu(self.linear(n, p+'mlp.gate_proj')) * self.linear(n, p+'mlp.up_proj')
|
||||
h = h + self.linear(activation, p+'mlp.down_proj')
|
||||
del n, out, activation
|
||||
if trim is not None:
|
||||
trim(0)
|
||||
self.position = stop
|
||||
return self.norm(h, 'norm')
|
||||
|
||||
|
||||
def greedy_tokens(hidden, embedding):
|
||||
"""Take the argmax over the complete tied vocabulary in bounded blocks."""
|
||||
peak = hidden.new_full((len(hidden),), -torch.inf)
|
||||
ids = torch.zeros(len(hidden), dtype=torch.long)
|
||||
start = 0
|
||||
for weight in weight_chunks(embedding, 0, embedding.shape[0], rows=1024):
|
||||
score, arg = F.linear(hidden, weight).max(dim=-1)
|
||||
ids = torch.where(score > peak, arg + start, ids)
|
||||
peak = torch.maximum(peak, score)
|
||||
start += len(weight)
|
||||
if not torch.isfinite(peak).all():
|
||||
raise FloatingPointError('Non-finite next-token score')
|
||||
return ids
|
||||
|
||||
|
||||
@torch.no_grad()
|
||||
def generate(source, prompts, schedules, stop_tokens, max_new_tokens, adapters=None):
|
||||
width = max(map(len, prompts))
|
||||
padding = [width - len(prompt) for prompt in prompts]
|
||||
seed = torch.tensor([[0] * n + prompt for prompt, n in zip(prompts, padding)])
|
||||
decoder = GenerationDecoder(source, schedules, padding, adapters)
|
||||
head = source.tensors[PREFIX+'embed_tokens.weight']
|
||||
state = decoder.advance(seed)[:, -1]
|
||||
output = [[] for _ in prompts]
|
||||
finished = [False] * len(prompts)
|
||||
for step in range(max_new_tokens):
|
||||
ids = greedy_tokens(state, head)
|
||||
for row, token in enumerate(ids.tolist()):
|
||||
if not finished[row]:
|
||||
output[row].append(token)
|
||||
finished[row] = token in stop_tokens
|
||||
if all(finished) or step + 1 == max_new_tokens:
|
||||
break
|
||||
state = decoder.advance(ids[:, None])[:, -1]
|
||||
return [(tokens, 'eos' if done else 'max_new_tokens') for tokens, done in zip(output, finished)]
|
||||
@@ -0,0 +1,265 @@
|
||||
"""Single-site LiSA-style pilot on the retained Qwen3.5-2B checkpoint."""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
import random
|
||||
import time
|
||||
|
||||
import numpy as np
|
||||
from tokenizers import Tokenizer
|
||||
|
||||
from crossqkv.core import QKVModel, assignment
|
||||
from functional.model import PREFIX
|
||||
from functional.run import write_json
|
||||
from pilot.tensors import decode
|
||||
|
||||
DONOR, TARGET = 19, 23
|
||||
WIDTH = 32
|
||||
MODES = ('native', 'direct', 'permutation', 'mix', 'local32', 'mix_local32')
|
||||
|
||||
|
||||
def scores(q, k):
|
||||
keys = np.repeat(k, q.shape[2] // k.shape[2], axis=2)
|
||||
return np.einsum('bthd,bshd->bhts', q, keys) / np.float32(np.sqrt(q.shape[-1]))
|
||||
|
||||
|
||||
def probabilities(x):
|
||||
x = np.where(np.tri(x.shape[-1], dtype=bool), x, -np.inf)
|
||||
exp = np.exp(x - x.max(axis=-1, keepdims=True))
|
||||
return exp / exp.sum(axis=-1, keepdims=True)
|
||||
|
||||
|
||||
def centered_rows(x, lengths):
|
||||
values = []
|
||||
for i, length in enumerate(lengths):
|
||||
query, key = np.tril_indices(length)
|
||||
board = x[i, :, :length, :length]
|
||||
mean = np.where(np.tri(length, dtype=bool), board, 0).sum(-1) / np.arange(1, length + 1)
|
||||
centered = board - mean[..., None]
|
||||
values.append(centered[:, query, key].T)
|
||||
return np.concatenate(values).astype(np.float64)
|
||||
|
||||
|
||||
def solve(x, y):
|
||||
gram = x.T @ x
|
||||
ridge = 1e-3 * np.trace(gram) / gram.shape[0]
|
||||
return np.linalg.solve(gram + max(ridge, 1e-12) * np.eye(len(gram)), x.T @ y).astype(np.float32)
|
||||
|
||||
|
||||
def fit(donor, target, local):
|
||||
cost = np.mean((target[:, :, None] - donor[:, None, :]) ** 2, axis=0)
|
||||
perm = assignment(cost)
|
||||
return {
|
||||
'permutation': list(perm),
|
||||
'mix': solve(donor, target),
|
||||
'local32': solve(local, target),
|
||||
'mix_local32': solve(np.concatenate((donor, local), axis=1), target),
|
||||
}
|
||||
|
||||
|
||||
def predict(donor, local, mode, mapping):
|
||||
if mode == 'direct':
|
||||
return donor
|
||||
if mode == 'permutation':
|
||||
return donor[:, mapping[mode]]
|
||||
if mode == 'mix':
|
||||
inputs = donor
|
||||
elif mode == 'local32':
|
||||
inputs = local
|
||||
else:
|
||||
inputs = np.concatenate((donor, local), axis=1)
|
||||
return np.einsum('bhts,hi->bits', inputs, mapping[mode])
|
||||
|
||||
|
||||
class Study(QKVModel):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
dim = self.config['head_dim']
|
||||
if dim % WIDTH:
|
||||
raise ValueError('Expected head dimension divisible by fixed local width')
|
||||
# Deterministic channel sample in post-RoPE Q/K coordinates.
|
||||
self.coordinates = np.arange(0, dim, dim // WIDTH)
|
||||
self.capture_scores = False
|
||||
|
||||
def normalization(self, x, name):
|
||||
if self.capture_scores and name == f'layers.{TARGET}.input_layernorm':
|
||||
self.recipient_input = x
|
||||
return super().normalization(x, name)
|
||||
|
||||
def full_attention(self, h, layer, shared_p=None):
|
||||
if not self.capture_scores or layer not in (DONOR, TARGET):
|
||||
return super().full_attention(h, layer, shared_p)
|
||||
parts = self.parts(h, layer, heads=False)
|
||||
if layer == DONOR:
|
||||
self.donor = scores(parts['q'], parts['k'])
|
||||
else:
|
||||
q, k = parts['q'], parts['k']
|
||||
self.teacher = scores(q, k)
|
||||
self.local = scores(q[..., self.coordinates], k[..., self.coordinates])
|
||||
self.recipient = parts
|
||||
return parts['output'], parts['p']
|
||||
|
||||
def replay(self, modes):
|
||||
if TARGET != len(self.config['layer_types']) - 1:
|
||||
raise ValueError('Replay requires changing only the final layer')
|
||||
parts = self.recipient
|
||||
repeats = self.config['num_attention_heads'] // self.config['num_key_value_heads']
|
||||
values = np.repeat(parts['v'], repeats, axis=2)
|
||||
contexts = [np.einsum('bhts,bshd->bthd',
|
||||
probabilities(predict(self.donor, self.local, mode, self.mapping)),
|
||||
values) for mode in modes]
|
||||
context = np.concatenate([parts['context'], *contexts])
|
||||
gate = np.concatenate([parts['gate']] * (1 + len(modes)))
|
||||
residual = np.concatenate([self.recipient_input] * (1 + len(modes)))
|
||||
hidden = residual + self.project(context, gate, TARGET)
|
||||
mlp_input = self.normalization(hidden, f'layers.{TARGET}.post_attention_layernorm')
|
||||
return np.split(self.normalization(hidden + self.mlp(mlp_input, TARGET), 'norm'),
|
||||
1 + len(modes))
|
||||
|
||||
|
||||
def dataset(split, count):
|
||||
seed = {'calibration': 2026112201, 'test4': 2026112202, 'test8': 2026112203}[split]
|
||||
rng = random.Random(seed)
|
||||
size = 8 if split == 'test8' else 4
|
||||
words = ('amber', 'birch', 'cedar', 'dune', 'elm', 'fern', 'grove', 'heath',
|
||||
'iris', 'jade', 'kelp', 'larch', 'maple', 'nettle', 'olive', 'pine')
|
||||
examples = []
|
||||
answers = [i % 4 for i in range(count)]
|
||||
rng.shuffle(answers)
|
||||
for i, answer in enumerate(answers):
|
||||
keys = rng.sample(words, size)
|
||||
values = rng.sample(range(10, 100), size)
|
||||
index = i % size
|
||||
other = rng.sample([v for j, v in enumerate(values) if j != index], 3)
|
||||
other.insert(answer, values[index])
|
||||
items = '\n'.join(f'{k}: {v}' for k, v in zip(keys, values))
|
||||
options = '\n'.join(f'{j + 1}. {v}' for j, v in enumerate(other))
|
||||
prompt = (f'Use the lookup table. Answer with only the option number.\n{items}\n'
|
||||
f'Which option is the value for {keys[index]}?\n{options}\nAnswer:')
|
||||
examples.append({'id': f'{split}-{i:03}', 'prompt': prompt, 'answer_index': answer,
|
||||
'evidence_position': index, 'entries': size})
|
||||
return examples
|
||||
|
||||
|
||||
def batch(tokenizer, examples):
|
||||
encoded = []
|
||||
choices = None
|
||||
for ex in examples:
|
||||
continuations = [tokenizer.encode(f"{ex['prompt']} {i}", add_special_tokens=False).ids
|
||||
for i in range(1, 5)]
|
||||
prefix = continuations[0][:-1]
|
||||
labels = [row[-1] for row in continuations]
|
||||
if any(row[:-1] != prefix for row in continuations) or len(set(labels)) != 4:
|
||||
raise ValueError('Choices must differ only at the final token')
|
||||
if choices is not None and labels != choices:
|
||||
raise ValueError('Choice tokenization varies by prompt')
|
||||
encoded.append(prefix)
|
||||
choices = labels
|
||||
lengths = [len(ids) for ids in encoded]
|
||||
ids = np.array([row + [0] * (max(lengths) - len(row)) for row in encoded], dtype=np.int64)
|
||||
return ids, lengths, choices
|
||||
|
||||
|
||||
def evaluate(lm, tokenizer, examples, batch_size=4):
|
||||
results = {mode: [] for mode in MODES}
|
||||
for start in range(0, len(examples), batch_size):
|
||||
group = examples[start:start + batch_size]
|
||||
ids, lengths, choices = batch(tokenizer, group)
|
||||
n = len(group)
|
||||
lm.capture_scores = True
|
||||
native, _ = lm.forward(ids)
|
||||
lm.capture_scores = False
|
||||
replay_native, *replayed = lm.replay(MODES[1:])
|
||||
if not np.allclose(replay_native, native, atol=2e-5, rtol=1e-5):
|
||||
raise ValueError('Native last-layer replay parity failed')
|
||||
token_rows = lm.tensors[PREFIX + 'embed_tokens.weight']
|
||||
weight = decode(token_rows.raw.reshape(token_rows.shape)[choices], token_rows.dtype)
|
||||
token_rows.evict()
|
||||
for mode, hidden in zip(MODES, [native, *replayed]):
|
||||
logits = hidden[np.arange(n), np.array(lengths) - 1] @ weight.T
|
||||
for ex, row, length in zip(group, logits.astype(float), lengths):
|
||||
gold = ex['answer_index']
|
||||
results[mode].append({
|
||||
'id': ex['id'], 'length': length, 'gold': gold,
|
||||
'logits': row.tolist(), 'predicted': int(row.argmax()),
|
||||
'choice_nll': float(np.logaddexp.reduce(row) - row[gold]),
|
||||
'margin': float(row[gold] - np.max(np.delete(row, gold))),
|
||||
})
|
||||
print(f"{group[-1]['id']}: evaluated {n} prompts in all six modes", flush=True)
|
||||
return results
|
||||
|
||||
|
||||
def summarize(results):
|
||||
return {split: {mode: {
|
||||
'n': len(rows),
|
||||
'correct': sum(row['gold'] == row['predicted'] for row in rows),
|
||||
'mean_choice_nll': float(np.mean([row['choice_nll'] for row in rows])),
|
||||
'mean_margin': float(np.mean([row['margin'] for row in rows])),
|
||||
'prediction_agreement_with_native': sum(row['predicted'] == base['predicted']
|
||||
for row, base in zip(rows, modes['native'])),
|
||||
} for mode, rows in modes.items()} for split, modes in results.items()}
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--source', type=Path, required=True)
|
||||
parser.add_argument('--out', type=Path, required=True)
|
||||
parser.add_argument('--calibration-run', type=Path, help='Reuse a matching completed calibration')
|
||||
parser.add_argument('--seconds', type=int, default=1800)
|
||||
args = parser.parse_args()
|
||||
start = time.monotonic()
|
||||
args.out.mkdir()
|
||||
source = args.source
|
||||
config = json.loads((source / 'model_config.json').read_text())
|
||||
tokenizer = Tokenizer.from_file(str(source / 'tokenizer.json'))
|
||||
lm = Study(source / 'weights', config, seconds=args.seconds)
|
||||
kinds = lm.config['layer_types']
|
||||
if any(kinds[i] != 'full_attention' for i in (DONOR, TARGET)):
|
||||
raise ValueError('Requires the retained architecture with full attention at 19 and 23')
|
||||
source_files = ['model_config.json', 'tokenizer.json', 'manifest.json']
|
||||
protocol = {'donor': DONOR, 'target': TARGET, 'local_coordinate_count': WIDTH,
|
||||
'modes': MODES, 'source': str(source),
|
||||
'source_sha256': {f: hashlib.sha256((source/f).read_bytes()).hexdigest() for f in source_files},
|
||||
'choice_nll_scope': 'normalized over four option-number logits only'}
|
||||
problems = {s: dataset(s, n) for s, n in [('calibration', 12), ('test4', 12), ('test8', 12)]}
|
||||
if len({e['prompt'] for entries in problems.values() for e in entries}) != 36:
|
||||
raise ValueError('Repeated prompt across pilot sample')
|
||||
write_json(args.out / 'protocol.json', protocol)
|
||||
write_json(args.out / 'problems.json', problems)
|
||||
|
||||
if args.calibration_run:
|
||||
previous = args.calibration_run
|
||||
if (json.loads((previous / 'protocol.json').read_text()) !=
|
||||
json.loads((args.out / 'protocol.json').read_text()) or
|
||||
json.loads((previous / 'problems.json').read_text()) != problems):
|
||||
raise ValueError('Calibration inputs or checkpoint provenance differ')
|
||||
lm.mapping = {k: np.asarray(v, dtype=np.int64 if k == 'permutation' else np.float32)
|
||||
for k, v in json.loads((previous / 'calibration.json').read_text()).items()}
|
||||
else:
|
||||
ids, lengths, _ = batch(tokenizer, problems['calibration'])
|
||||
lm.capture_scores = True
|
||||
native, _ = lm.forward(ids)
|
||||
measured = [centered_rows(x, lengths) for x in (lm.donor, lm.teacher, lm.local)]
|
||||
lm.capture_scores = False
|
||||
reference, _ = lm.forward(ids[:4])
|
||||
if not np.allclose(native[:4], reference, atol=1e-5, rtol=1e-5):
|
||||
raise ValueError('Capture path disagrees with the unmodified reference')
|
||||
lm.mapping = fit(*measured)
|
||||
print('Calibration ready', flush=True)
|
||||
write_json(args.out / 'calibration.json', {
|
||||
k: np.asarray(v).tolist() for k, v in lm.mapping.items()
|
||||
})
|
||||
results = {}
|
||||
for split in ('test4', 'test8'):
|
||||
results[split] = evaluate(lm, tokenizer, problems[split])
|
||||
print(split, summarize(results)[split], flush=True)
|
||||
write_json(args.out / 'results.json', results)
|
||||
write_json(args.out / 'summary.json', {'sets': summarize(results),
|
||||
'native_last_layer_replay_parity': True,
|
||||
'calibration_reused': bool(args.calibration_run),
|
||||
'seconds': time.monotonic() - start})
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,153 @@
|
||||
"""Compare diagnostic rank allocation and uniform ranks under matched training."""
|
||||
import argparse
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import torch
|
||||
from tokenizers import Tokenizer
|
||||
|
||||
from crossqkv.lisa_combination_screen import ADAPTER_SHA, SITES
|
||||
from crossqkv.lisa_effect_answer_audit import vocabulary_scores
|
||||
from crossqkv.lisa_full_answer import STOP_TEXT, fingerprint, prompt
|
||||
from crossqkv.lisa_full_answer_train import FitCapture, load_locked, train, verified_fit_captures
|
||||
from crossqkv.lisa_tail import TorchTail
|
||||
from crossqkv.lisa_train import LearnableSharingAttention
|
||||
from functional.model import PREFIX, StreamingLM
|
||||
from functional.run import write_json
|
||||
|
||||
|
||||
def assignments(protocol, directory):
|
||||
expected = [(q['id'], q['answer']) for q in protocol['splits']['diagnostic']]
|
||||
scores = {}
|
||||
for label in ('baseline', *(f'restore-{i}' for i in SITES)):
|
||||
rows = json.loads((directory/(label+'.json')).read_text())
|
||||
if [(r['id'], r['gold']) for r in rows] != expected:
|
||||
raise ValueError(f'Incomplete diagnostic arm {label}')
|
||||
scores[label] = sum(r['arms'][label]['correct'] for r in rows)
|
||||
ordered = sorted(SITES, key=lambda i: (-scores[f'restore-{i}'], i))
|
||||
selected = dict(zip(ordered, reversed(protocol['rank_budget'])))
|
||||
reverse = dict(zip(ordered, protocol['rank_budget']))
|
||||
return scores, {'allocated':selected, 'reversed':reverse, 'uniform':dict.fromkeys(SITES, 40)}
|
||||
|
||||
|
||||
def local_scores_only(module, args):
|
||||
local, donor = args[0].chunk(2, dim=-1)
|
||||
return (torch.cat((local, torch.zeros_like(donor)), dim=-1),)
|
||||
|
||||
|
||||
def make_adapters(config, ranks, shared):
|
||||
rope = config['rope_parameters']
|
||||
adapters = {i: LearnableSharingAttention(config['hidden_size'], config['num_attention_heads'],
|
||||
config['num_key_value_heads'], ranks[i], rope['rope_theta'], rope['partial_rotary_factor'],
|
||||
bias=config.get('attention_bias', False)) for i in SITES}
|
||||
if not shared:
|
||||
for adapter in adapters.values():
|
||||
adapter.fuse.register_forward_pre_hook(local_scores_only)
|
||||
return adapters
|
||||
|
||||
|
||||
def score_gold_answers(outputs, sequences, starts, embedding):
|
||||
gold = [ids[first:] for ids, first in zip(sequences, starts)]
|
||||
targets = torch.tensor([token for answer in gold for token in answer])
|
||||
sizes = [len(answer) for answer in gold]
|
||||
vectors = torch.cat([out[i, first-1:len(ids)-1] for out in outputs.values()
|
||||
for i, (ids, first) in enumerate(zip(sequences, starts))])
|
||||
_, nll = vocabulary_scores(vectors, targets.repeat(len(outputs)), embedding)
|
||||
if not torch.isfinite(nll).all():
|
||||
raise FloatingPointError('Invalid full-vocabulary diagnostic score')
|
||||
scores = [{} for _ in gold]
|
||||
for label, values in zip(outputs, nll.split(len(targets))):
|
||||
for row, part in zip(scores, values.split(sizes)):
|
||||
row[label] = (-part).tolist()
|
||||
return gold, scores
|
||||
|
||||
|
||||
@torch.no_grad()
|
||||
def diagnostic_log_probs(model, tok, weights, questions, path):
|
||||
"""Teacher-force gold answers; all restorations share the same frozen stem."""
|
||||
if fingerprint(weights) != ADAPTER_SHA:
|
||||
raise ValueError('Unexpected diagnostic checkpoint')
|
||||
adapters = make_adapters(model.config, dict.fromkeys(SITES, 40), True)
|
||||
tail = TorchTail(model, SITES[0], adapters)
|
||||
tail.adapters.load_state_dict(torch.load(weights, weights_only=True, map_location='cpu'))
|
||||
native = FitCapture(model, 0)
|
||||
native.sites = SITES
|
||||
rows = json.loads(path.read_text()) if path.exists() else []
|
||||
if [r['id'] for r in rows] != [q['id'] for q in questions[:len(rows)]]:
|
||||
raise ValueError('Unexpected gold-score prefix')
|
||||
for start in range(len(rows), len(questions), 2):
|
||||
batch = questions[start:start+2]
|
||||
sequences, starts = [], []
|
||||
for item in batch:
|
||||
text = prompt(item['question'])
|
||||
base = tok.encode(text, add_special_tokens=False).ids
|
||||
ids = tok.encode(text + str(item['answer']) + STOP_TEXT[0], add_special_tokens=False).ids
|
||||
if ids[:len(base)] != base or len(ids) <= len(base):
|
||||
raise ValueError('Gold answer is not an extension of its prompt')
|
||||
sequences.append(ids)
|
||||
starts.append(len(base))
|
||||
lengths = torch.tensor([len(ids)-1 for ids in sequences])
|
||||
width = int(lengths.max())
|
||||
padded = torch.tensor([ids[:-1] + [0]*(width-len(ids)+1) for ids in sequences])
|
||||
h = torch.from_numpy(model.embedding(padded.numpy()))
|
||||
original, maps = native(h, None, lengths, 'native', ())
|
||||
outputs = {'native':original}
|
||||
for restored in (None, *SITES):
|
||||
sites = tuple(i for i in SITES if i != restored)
|
||||
label = 'baseline' if restored is None else f'restore-{restored}'
|
||||
outputs[label], _ = tail(native.residual, maps[SITES[0]-4][0], lengths, 'lisa', sites)
|
||||
gold_tokens, log_probs = score_gold_answers(outputs, sequences, starts,
|
||||
model.tensors[PREFIX+'embed_tokens.weight'])
|
||||
results = [{'id': item['id'], 'gold': item['answer'], 'tokens': gold, 'log_probs': scores}
|
||||
for item, gold, scores in zip(batch, gold_tokens, log_probs)]
|
||||
rows.extend(results)
|
||||
write_json(path, rows)
|
||||
print('diagnostic gold sequence', len(rows), '/', len(questions), flush=True)
|
||||
|
||||
|
||||
def main():
|
||||
p = argparse.ArgumentParser(description=__doc__)
|
||||
for name in ('source','prior','out'):
|
||||
p.add_argument('--'+name, type=Path, required=True)
|
||||
args = p.parse_args()
|
||||
torch.set_num_threads(1)
|
||||
protocol_file = args.out/'protocol.json'
|
||||
if fingerprint(protocol_file) != '6858dbc64db0b989e8112e9dbea70662a2a05f66f11b180e8f2c668c74c43aef':
|
||||
raise ValueError('Protocol mismatch')
|
||||
protocol = json.loads(protocol_file.read_text())
|
||||
scores, ranks = assignments(protocol,args.out)
|
||||
_, prior = load_locked(args.source,args.prior)
|
||||
source = args.prior/'final'
|
||||
captures = source/'fit-capture'
|
||||
fit = [r for r in prior['problems']['fit'] if r['task']=='lookup']
|
||||
verified_fit_captures(source, fit)
|
||||
config = json.loads((args.source/'model_config.json').read_text())
|
||||
tok = Tokenizer.from_file(str(args.source/'tokenizer.json'))
|
||||
diagnostic_model = StreamingLM(args.source/'weights', config, seconds=172800, process_swap_limit_kib=None)
|
||||
diagnostic_log_probs(diagnostic_model, tok, source/'lisa.pt', protocol['splits']['diagnostic'],
|
||||
args.out/'diagnostic-gold-log-probs.json')
|
||||
del diagnostic_model
|
||||
arms = [('allocated',True),('uniform',True),('reversed',True),
|
||||
('uniform',False),('allocated',False)]
|
||||
for allocation, shared in arms:
|
||||
label = ('shared-' if shared else 'local-')+allocation
|
||||
out = args.out/label
|
||||
out.mkdir(exist_ok=True)
|
||||
torch.manual_seed(621011)
|
||||
model = StreamingLM(args.source/'weights',config,seconds=172800,process_swap_limit_kib=None)
|
||||
model.sites = SITES
|
||||
adapters = make_adapters(model.config, ranks[allocation], shared)
|
||||
count = sum(p.numel() for adapter in adapters.values() for p in adapter.parameters())
|
||||
spec = {'diagnostic_correct':scores,'ranks':{str(k):v for k,v in ranks[allocation].items()},
|
||||
'shared':shared,'parameters':count,'seed':621011,'epochs':2}
|
||||
path = out/'config.json'
|
||||
if count != 2476032 or (path.exists() and json.loads(path.read_text()) != spec):
|
||||
raise ValueError('Unmatched rank budget or run configuration')
|
||||
write_json(path,spec)
|
||||
if not (out/'lisa.pt').exists():
|
||||
train(model,tok,out,protocol['splits'],2,40,adapters=adapters,captures=captures)
|
||||
print(label,'finished',flush=True)
|
||||
|
||||
|
||||
if __name__=='__main__':
|
||||
main()
|
||||
@@ -0,0 +1,103 @@
|
||||
"""Measure how much native attention score error extra rank can remove on frozen fit captures."""
|
||||
import argparse
|
||||
import hashlib
|
||||
import io
|
||||
import json
|
||||
from itertools import permutations
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
||||
RECEIPT_SHA = '682bc035a5bed9f9245f589cacf3e9616300e8bf5e85d3743b1264a56360fa55'
|
||||
RANKS = (32, 40, 48)
|
||||
|
||||
|
||||
def matrices(directory, record):
|
||||
data = (directory / record['file']).read_bytes()
|
||||
if hashlib.sha256(data).hexdigest() != record['sha256']:
|
||||
raise ValueError(f"Capture changed for {record['id']}")
|
||||
with np.load(io.BytesIO(data), allow_pickle=False) as capture:
|
||||
donor = capture['donor'][0].astype(np.float64)
|
||||
teachers = capture['teacher'][:, 0].astype(np.float64)
|
||||
length = capture['ids'].shape[1]
|
||||
start = int(capture['start'][0])
|
||||
if start != record['input_tokens'] or length - start != record['answer_and_eos_tokens']:
|
||||
raise ValueError(f"Unexpected token counts for {record['id']}")
|
||||
if teachers.shape != (3, 8, length, length) or donor.shape != teachers.shape[1:]:
|
||||
raise ValueError(f"Unexpected score shapes for {record['id']}")
|
||||
features = donor.reshape(8, -1).T
|
||||
features = np.column_stack((features, np.ones(length * length)))
|
||||
targets = teachers.reshape(24, -1).T
|
||||
return features, targets, length
|
||||
|
||||
|
||||
def layer_designs(donor, teachers, adjacent_native):
|
||||
for layer, target in enumerate(np.hsplit(teachers, 3)):
|
||||
if adjacent_native and layer:
|
||||
start = (layer - 1) * 8
|
||||
features = np.column_stack((teachers[:, start:start + 8], donor[:, -1]))
|
||||
else:
|
||||
features = donor
|
||||
yield features, target
|
||||
|
||||
|
||||
def measure(prior, adjacent_native=False):
|
||||
raw = (prior / 'verified-fit-capture.json').read_bytes()
|
||||
if hashlib.sha256(raw).hexdigest() != RECEIPT_SHA:
|
||||
raise ValueError('Expected the verified 24-example native score capture')
|
||||
receipt = json.loads(raw)
|
||||
records = receipt['records']
|
||||
sites = receipt['recipients']
|
||||
directory = prior / 'fit-capture'
|
||||
# Fit one affine donor-head map on each half of the training examples.
|
||||
gram = np.zeros((2, 3, 9, 9))
|
||||
cross = np.zeros((2, 3, 9, 8))
|
||||
for i, record in enumerate(records):
|
||||
donor, teachers, _ = matrices(directory, record)
|
||||
for layer, (x, y) in enumerate(layer_designs(donor, teachers, adjacent_native)):
|
||||
gram[i % 2, layer] += x.T @ x
|
||||
cross[i % 2, layer] += x.T @ y
|
||||
coefficients = np.linalg.solve(gram, cross)
|
||||
|
||||
rows = []
|
||||
for i, record in enumerate(records):
|
||||
donor, teachers, length = matrices(directory, record)
|
||||
errors = [(y - x @ coef).T.reshape(8, length, length)
|
||||
for (x, y), coef in zip(layer_designs(donor, teachers, adjacent_native),
|
||||
coefficients[1 - i % 2])]
|
||||
residual = np.stack(errors)
|
||||
singular_values = np.linalg.svd(residual, compute_uv=False)
|
||||
energy = singular_values**2
|
||||
np.testing.assert_allclose(energy.sum(-1), (residual**2).sum(axis=(-1, -2)), rtol=1e-10)
|
||||
rows.append({
|
||||
'id': record['id'], 'length': length,
|
||||
'mse': {str(site): {str(rank): float(energy[j, :, rank:].sum() / (8 * length**2))
|
||||
for rank in (0, *RANKS)} for j, site in enumerate(sites)}
|
||||
})
|
||||
|
||||
means = {str(site): {str(rank): float(np.mean([r['mse'][str(site)][str(rank)] for r in rows]))
|
||||
for rank in (0, *RANKS)} for site in sites}
|
||||
uniform = np.array([np.mean([row['mse'][str(site)]['40'] for site in sites]) for row in rows])
|
||||
configs = []
|
||||
for ranks in ((40, 40, 40), *permutations(RANKS)):
|
||||
errors = [np.mean([row['mse'][str(site)][str(rank)] for site, rank in zip(sites, ranks)])
|
||||
for row in rows]
|
||||
configs.append({'ranks': list(ranks), 'mean_mse': float(np.mean(errors)),
|
||||
'examples_below_uniform_mse': int(np.sum(errors < uniform))})
|
||||
return {
|
||||
'source_receipt_sha256': RECEIPT_SHA, 'split': 'fit', 'sites': sites,
|
||||
**({'native_donor_layers': [11, 15, 19]} if adjacent_native else {'donor_layer': 11}),
|
||||
'donor_fit': 'affine, opposite index parity',
|
||||
'metric': 'mean per-example, per-layer, per-head, all token-pair squared raw score residual',
|
||||
'mean_mse': means, 'configurations': configs, 'examples': rows
|
||||
}
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('prior_final', type=Path)
|
||||
parser.add_argument('--adjacent-native', action='store_true',
|
||||
help='Use each previous native full-attention layer as the donor')
|
||||
args = parser.parse_args()
|
||||
print(json.dumps(measure(args.prior_final, args.adjacent_native), indent=2, allow_nan=False))
|
||||
@@ -0,0 +1,200 @@
|
||||
"""Capture Qwen sequences and train/evaluate the complete last-layer LiSA method."""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
|
||||
from crossqkv.forward_search import encode, problems, SEEDS
|
||||
from crossqkv.lisa_pilot import DONOR, TARGET, Study
|
||||
from functional.run import write_json
|
||||
|
||||
BATCH = 4
|
||||
EPOCHS = 8
|
||||
RANK = 40
|
||||
|
||||
|
||||
def digest(path):
|
||||
return hashlib.sha256(path.read_bytes()).hexdigest()
|
||||
|
||||
|
||||
def capture(source, out):
|
||||
from tokenizers import Tokenizer
|
||||
|
||||
model = Study(source / 'weights', json.loads((source / 'model_config.json').read_text()),
|
||||
seconds=3600)
|
||||
if TARGET != len(model.config['layer_types']) - 1:
|
||||
raise ValueError('Exact cached training requires the final layer as the only recipient')
|
||||
if any(model.config['layer_types'][i] != 'full_attention' for i in (DONOR, TARGET)):
|
||||
raise ValueError('Both sites must be full attention layers')
|
||||
model.capture_scores = True
|
||||
tokenizer = Tokenizer.from_file(str(source / 'tokenizer.json'))
|
||||
items = {split: problems(split) for split in SEEDS}
|
||||
write_json(out / 'problems.json', items)
|
||||
write_json(out / 'protocol.json', {
|
||||
'source_sha256': {name: digest(source / name) for name in
|
||||
('model_config.json', 'manifest.json', 'tokenizer.json')},
|
||||
'donor': DONOR, 'target': TARGET, 'rank_per_head': RANK, 'epochs': EPOCHS,
|
||||
'batch_size': BATCH, 'seed': 20261123, 'split_seeds': SEEDS,
|
||||
'optimizer': 'AdamW', 'learning_rate': .0003, 'weight_decay': .1,
|
||||
'objective': {'full_vocabulary_next_token_ce': .75, 'huber_delta_1': .25},
|
||||
})
|
||||
for split, rows in items.items():
|
||||
for start in range(0, len(rows), BATCH):
|
||||
batch = rows[start:start+BATCH]
|
||||
prefixes, lengths, labels = encode(tokenizer, batch)
|
||||
ids = np.pad(prefixes, ((0, 0), (0, 1)))
|
||||
gold = np.array([r['gold'] - 1 for r in batch])
|
||||
ids[np.arange(len(batch)), lengths] = np.asarray(labels)[gold]
|
||||
native, saved = model.forward(ids, capture=[('attn', TARGET)])
|
||||
rec = model.recipient
|
||||
np.savez(out / f'{split}-{start:02}.npz', ids=ids, lengths=lengths + 1,
|
||||
labels=labels, gold=gold, native=native, local=model.local,
|
||||
inp=saved[f'attn_{TARGET}'], donor=model.donor, teacher=model.teacher,
|
||||
values=rec['v'], gate=rec['gate'], residual=model.recipient_input)
|
||||
print(split, 'captured', start + len(batch), '/', len(rows), flush=True)
|
||||
|
||||
|
||||
def train(source, cache, out, linear_control):
|
||||
import torch
|
||||
|
||||
from crossqkv.forward_search_fit import LastLayer
|
||||
from crossqkv.lisa_train import (FrozenRecipient, LearnableSharingAttention, causal_attention,
|
||||
language_model_loss, objective)
|
||||
|
||||
torch.set_num_threads(1)
|
||||
torch.manual_seed(20261123)
|
||||
protocol = json.loads((cache / 'protocol.json').read_text())
|
||||
if any(digest(source / name) != sha for name, sha in protocol['source_sha256'].items()):
|
||||
raise ValueError('The cache does not match the selected source checkpoint')
|
||||
cfg = json.loads((source / 'model_config.json').read_text())['text_config']
|
||||
heads, kv = cfg['num_attention_heads'], cfg['num_key_value_heads']
|
||||
rp = cfg['rope_parameters']
|
||||
frozen = LastLayer(source)
|
||||
recipient = FrozenRecipient(frozen.weights, frozen.eps)
|
||||
adapter = LearnableSharingAttention(cfg['hidden_size'], heads, kv, RANK,
|
||||
rp['rope_theta'], rp['partial_rotary_factor'],
|
||||
bias=cfg.get('attention_bias', False))
|
||||
optimizer = torch.optim.AdamW(adapter.parameters(), lr=.0003, weight_decay=.1)
|
||||
t = frozen.embedding
|
||||
|
||||
def vocabulary():
|
||||
for start in range(0, t.shape[0], 1024):
|
||||
end = min(start + 1024, t.shape[0])
|
||||
yield start, torch.from_numpy(t.read(slice(start*t.shape[1], end*t.shape[1]))
|
||||
.reshape(end-start, t.shape[1]))
|
||||
t.evict()
|
||||
|
||||
def batches(split):
|
||||
for path in sorted(cache.glob(f'{split}-*.npz')):
|
||||
with np.load(path, allow_pickle=False) as data:
|
||||
yield {k: torch.from_numpy(data[k]) for k in data.files}
|
||||
|
||||
def adapter_scores(b):
|
||||
return adapter(b['inp'], b['donor'], torch.arange(b['ids'].shape[1])[None, :])
|
||||
|
||||
def decode(b, s):
|
||||
return recipient(causal_attention(s, b['values'], b['lengths']),
|
||||
b['gate'], b['residual'])
|
||||
|
||||
def losses(b, s, h):
|
||||
ce = language_model_loss(h, b['ids'], b['lengths'], vocabulary)
|
||||
total, kd = objective(s, b['teacher'], b['lengths'], ce)
|
||||
return total, ce, kd
|
||||
|
||||
def evaluate(split, modes, greedy=False):
|
||||
totals = {mode: [] for mode in modes}
|
||||
predictions = {mode: [] for mode in modes}
|
||||
with torch.no_grad():
|
||||
for b in batches(split):
|
||||
answer_at = b['lengths'] - 2
|
||||
valid = torch.arange(b['ids'].shape[1])[None, :] < b['lengths'][:, None]
|
||||
states = []
|
||||
for mode in modes:
|
||||
if mode == 'native':
|
||||
s = b['teacher']
|
||||
elif mode == 'direct':
|
||||
s = b['donor']
|
||||
elif mode == 'linear_joint':
|
||||
s = torch.einsum('bhts,hi->bits', torch.cat((b['donor'], b['local']), 1),
|
||||
linear_matrix)
|
||||
else:
|
||||
s = adapter_scores(b)
|
||||
h = decode(b, s)
|
||||
if mode == 'native':
|
||||
torch.testing.assert_close(h[valid], b['native'][valid], atol=4e-5, rtol=3e-5)
|
||||
loss = losses(b, s, h)
|
||||
totals[mode].append((int((b['lengths'] - 1).sum()),
|
||||
sum(int(n)**2 for n in b['lengths']),
|
||||
*map(float, loss)))
|
||||
states.append(h[torch.arange(len(answer_at)), answer_at].numpy())
|
||||
if greedy:
|
||||
preds = np.split(frozen.greedy(np.concatenate(states)), len(modes))
|
||||
labels = b['labels'][b['gold']].numpy()
|
||||
for mode, pred in zip(modes, preds):
|
||||
predictions[mode].extend((pred == labels).tolist())
|
||||
results = {}
|
||||
for mode, rows in totals.items():
|
||||
if not rows:
|
||||
raise ValueError(f'No complete capture batches for {split}')
|
||||
n = sum(r[0] for r in rows)
|
||||
pairs = sum(r[1] for r in rows)
|
||||
ce = sum(r[0] * r[3] for r in rows) / n
|
||||
kd = sum(r[1] * r[4] for r in rows) / pairs
|
||||
results[mode] = {'ce': ce, 'huber': kd, 'objective': .75 * ce + .25 * kd,
|
||||
'tokens': n, 'greedy_correct': sum(predictions[mode]),
|
||||
'greedy_n': len(predictions[mode])}
|
||||
return results
|
||||
|
||||
linear = json.loads(linear_control.read_text())['weights']['linear_joint']
|
||||
linear_matrix = torch.tensor(linear, dtype=torch.float32)
|
||||
trace = []
|
||||
best = float('inf')
|
||||
for epoch in range(EPOCHS):
|
||||
step_losses = []
|
||||
for batch in batches('fit'):
|
||||
optimizer.zero_grad(set_to_none=True)
|
||||
scores = adapter_scores(batch)
|
||||
loss = losses(batch, scores, decode(batch, scores))
|
||||
loss[0].backward()
|
||||
if any(p.grad is None or not torch.isfinite(p.grad).all() for p in adapter.parameters()):
|
||||
raise FloatingPointError('Invalid adapter gradient')
|
||||
optimizer.step()
|
||||
step_losses.append(list(map(lambda x: float(x.detach()), loss)))
|
||||
validation = evaluate('validation', ('lisa',))['lisa']
|
||||
trace.append({'epoch': epoch + 1, 'fit_batch_losses': step_losses, 'validation': validation})
|
||||
if validation['objective'] < best:
|
||||
best = validation['objective']
|
||||
torch.save(adapter.state_dict(), out / 'best-adapter.pt')
|
||||
write_json(out / 'trace.json', trace)
|
||||
print('epoch', epoch + 1, 'validation', validation, flush=True)
|
||||
adapter.load_state_dict(torch.load(out / 'best-adapter.pt', map_location='cpu', weights_only=True))
|
||||
modes = ('native', 'direct', 'linear_joint', 'lisa')
|
||||
result = {split: evaluate(split, modes, greedy=True) for split in ('validation', 'test')}
|
||||
result['best_epoch'] = min(trace, key=lambda r: r['validation']['objective'])['epoch']
|
||||
result['trainable_parameters'] = sum(p.numel() for p in adapter.parameters())
|
||||
result['linear_control_sha256'] = digest(linear_control)
|
||||
write_json(out / 'results.json', result)
|
||||
print(result, flush=True)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('phase', choices=('capture', 'train'))
|
||||
parser.add_argument('--source', required=True, type=Path)
|
||||
parser.add_argument('--out', required=True, type=Path)
|
||||
parser.add_argument('--cache', type=Path)
|
||||
parser.add_argument('--linear-control', type=Path)
|
||||
args = parser.parse_args()
|
||||
if args.phase == 'train' and (args.cache is None or args.linear_control is None):
|
||||
parser.error('train requires --cache and --linear-control')
|
||||
args.out.mkdir()
|
||||
if args.phase == 'capture':
|
||||
capture(args.source, args.out)
|
||||
else:
|
||||
train(args.source, args.cache, args.out, args.linear_control)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,196 @@
|
||||
"""Replay and separate the local and outgoing attention scores at one LiSA site."""
|
||||
import argparse
|
||||
import json
|
||||
import math
|
||||
import random
|
||||
from pathlib import Path
|
||||
|
||||
import torch
|
||||
from tokenizers import Tokenizer
|
||||
|
||||
from crossqkv.lisa_combination_screen import ADAPTER_SHA, SITES, paired_questions
|
||||
from crossqkv.lisa_effect_answer_audit import vocabulary_scores
|
||||
from crossqkv.lisa_full_answer import MAX_NEW_TOKENS, STOP_TEXT, fingerprint, grade, prompt
|
||||
from crossqkv.lisa_full_answer_train import load_locked
|
||||
from crossqkv.lisa_full_answer_verify import verify
|
||||
from crossqkv.lisa_generate import GenerationDecoder, greedy_tokens
|
||||
from crossqkv.lisa_rank_compare import make_adapters
|
||||
from crossqkv.lisa_tail import rotate
|
||||
from functional.model import PREFIX, StreamingLM
|
||||
from functional.run import write_json
|
||||
|
||||
|
||||
# Vary only layers 15 and 19 with native attention at layer 23 in all four arms.
|
||||
ISOLATION_SCHEDULES = {
|
||||
'native': (), 'only-15': (15,), 'only-19': (19,), 'both-15-19': (15, 19)
|
||||
}
|
||||
|
||||
|
||||
class PathDecoder(GenerationDecoder):
|
||||
def score_paths(self, h, layer, positions, scores):
|
||||
if layer != self.site or self.mode == 'baseline':
|
||||
return scores, scores
|
||||
c = self.c
|
||||
heads, kv, dim = (c[k] for k in ('num_attention_heads', 'num_key_value_heads', 'head_dim'))
|
||||
p = f'layers.{layer}.self_attn.'
|
||||
q = self.linear(h, p+'q_proj').unflatten(-1, (heads, 2*dim)).chunk(2, -1)[0]
|
||||
k = self.linear(h, p+'k_proj').unflatten(-1, (kv, dim))
|
||||
rope = c['rope_parameters']
|
||||
def rotated(x, name):
|
||||
return rotate(self.norm(x, p+name), rope['rope_theta'], rope['partial_rotary_factor'], positions)
|
||||
q = rotated(q, 'q_norm')
|
||||
k = rotated(k, 'k_norm')
|
||||
if self.position:
|
||||
k = torch.cat((self.native_keys, k), dim=1)
|
||||
self.native_keys = k
|
||||
native = torch.einsum('bthd,bshd->bhts', q, k.repeat_interleave(heads//kv, 2)) / math.sqrt(dim)
|
||||
if self.mode.startswith('read-group-'):
|
||||
group = int(self.mode.rsplit('-', 1)[1])
|
||||
chosen = torch.arange(heads) // (heads // kv) == group
|
||||
return torch.where(chosen[None, :, None, None], native, scores), scores
|
||||
if self.mode == 'send-permuted':
|
||||
# Exchange the two GQA groups while retaining the same score entries.
|
||||
return scores, native.roll(heads // kv, dims=1)
|
||||
return (native if self.mode in ('read','both') else scores,
|
||||
native if self.mode in ('send','both') else scores)
|
||||
|
||||
|
||||
def questions(name, count, seed):
|
||||
swap = paired_questions(name, count, seed)
|
||||
query = []
|
||||
for first, second in zip(swap[::2], swap[1::2]):
|
||||
records, ask = first['question'].split('.\n')
|
||||
table = dict(x.split('=') for x in records.removeprefix('Records in time order: ').split(', '))
|
||||
key = next(k for k,v in table.items() if int(v)==second['answer'])
|
||||
query.extend([dict(first,id=first['id']+'-query'),
|
||||
dict(second,id=second['id']+'-query',question=records+'.\n'+ask.rsplit(' ',1)[0]+' '+key+'?')])
|
||||
return {'swap':swap, 'query':query}
|
||||
|
||||
|
||||
@torch.no_grad()
|
||||
def batch(model, tok, adapters, qs, site, mode):
|
||||
ids = [tok.encode(prompt(q['question']),add_special_tokens=False).ids for q in qs]
|
||||
width = max(map(len,ids))
|
||||
padding = [width-len(x) for x in ids]
|
||||
if mode in ISOLATION_SCHEDULES:
|
||||
schedule = ISOLATION_SCHEDULES[mode]
|
||||
dec = GenerationDecoder(model, [schedule]*len(qs), padding,
|
||||
{layer: adapters[layer] for layer in schedule})
|
||||
else:
|
||||
dec = PathDecoder(model,[SITES]*len(qs),padding,adapters)
|
||||
dec.site, dec.mode = site, mode
|
||||
h = dec.advance(torch.tensor([[0]*p+x for p,x in zip(padding,ids)]))[:,-1]
|
||||
head = model.tensors[PREFIX+'embed_tokens.weight']
|
||||
gold = torch.tensor([tok.encode(str(q['answer']),add_special_tokens=False).ids[0] for q in qs])
|
||||
nxt,nll = vocabulary_scores(h,gold,head)
|
||||
stops = {tok.token_to_id(t) for t in STOP_TEXT}
|
||||
seq = [[] for _ in qs]
|
||||
for step in range(MAX_NEW_TOKENS):
|
||||
for s,t in zip(seq,nxt.tolist()):
|
||||
if not s or s[-1] not in stops:
|
||||
s.append(t)
|
||||
if all(s[-1] in stops for s in seq) or step+1==MAX_NEW_TOKENS:
|
||||
break
|
||||
nxt = greedy_tokens(dec.advance(nxt[:,None])[:,-1],head)
|
||||
return [dict(id=q['id'],task=q['task'],gold=q['answer'],first_digit_probability=float((-v).exp()),
|
||||
arms={mode:grade(tok,s,'eos' if s[-1] in stops else 'max_new_tokens',q['answer'])})
|
||||
for q,s,v in zip(qs,seq,nll)]
|
||||
|
||||
|
||||
def main():
|
||||
p = argparse.ArgumentParser()
|
||||
for k in ('source','prior','previous','out'):
|
||||
p.add_argument('--'+k,type=Path,required=True)
|
||||
p.add_argument('--follow-through', action='store_true')
|
||||
a=p.parse_args()
|
||||
torch.set_num_threads(1)
|
||||
_,old=load_locked(a.source,a.prior)
|
||||
assert fingerprint(a.previous/'protocol.json')=='6858dbc64db0b989e8112e9dbea70662a2a05f66f11b180e8f2c668c74c43aef'
|
||||
prev=json.loads((a.previous/'protocol.json').read_text())['splits']
|
||||
plan={'replay':prev['diagnostic'],'diagnostic':questions('paths-dev',8,120201),
|
||||
'holdout':questions('paths-test',32,120202)}
|
||||
used={q['question'] for split in old['problems'].values() for q in split}
|
||||
used.update(q['question'] for split in prev.values() for q in split)
|
||||
for key in ('diagnostic','holdout'):
|
||||
fresh={q['question'] for group in plan[key].values() for q in group}
|
||||
assert not fresh & used
|
||||
used.update(fresh)
|
||||
a.out.mkdir(exist_ok=True,parents=True)
|
||||
path=a.out/'protocol.json'
|
||||
assert not path.exists() or json.loads(path.read_text())==plan
|
||||
write_json(path,plan)
|
||||
model=StreamingLM(a.source/'weights',json.loads((a.source/'model_config.json').read_text()),seconds=172800,process_swap_limit_kib=None)
|
||||
tok=Tokenizer.from_file(str(a.source/'tokenizer.json'))
|
||||
weights=a.prior/'final/lisa.pt'
|
||||
assert fingerprint(weights)==ADAPTER_SHA
|
||||
adapters=make_adapters(model.config,dict.fromkeys(SITES,40),True)
|
||||
torch.nn.ModuleDict({str(k):v for k,v in adapters.items()}).load_state_dict(torch.load(weights,weights_only=True))
|
||||
def evaluate(split, site, modes):
|
||||
for mode in modes:
|
||||
groups={'old':plan['replay']} if split=='replay' else plan[split]
|
||||
for kind,qs in groups.items():
|
||||
path=a.out/f'{split}-{site}-{mode}-{kind}.json'
|
||||
rows=json.loads(path.read_text()) if path.exists() else []
|
||||
expected=None
|
||||
if split=='replay':
|
||||
label='baseline' if mode=='baseline' else 'restore-19'
|
||||
expected=json.loads((a.previous/(label+'.json')).read_text())
|
||||
def check(items, saved):
|
||||
verify(tok,old['protocol'],items,saved,(mode,))
|
||||
if expected is not None:
|
||||
oracle={r['id']:r['arms'][label] for r in expected}
|
||||
assert all(r['arms'][mode]==oracle[r['id']] for r in saved)
|
||||
if rows:
|
||||
check(qs[:len(rows)],rows)
|
||||
for start in range(len(rows),len(qs),2):
|
||||
items=qs[start:start+2]
|
||||
generated=batch(model,tok,adapters,items,site,mode)
|
||||
check(items,generated)
|
||||
rows.extend(generated)
|
||||
write_json(path,rows)
|
||||
print(path.name,len(rows),flush=True)
|
||||
|
||||
for split, site, modes in [
|
||||
('replay', 19, ('baseline', 'both')),
|
||||
('diagnostic', 19, ('baseline', 'both', 'read', 'send')),
|
||||
('diagnostic', 15, ('both', 'read', 'send'))]:
|
||||
evaluate(split, site, modes)
|
||||
if not a.follow_through:
|
||||
return
|
||||
|
||||
evaluate('diagnostic', 'isolation', ISOLATION_SCHEDULES)
|
||||
|
||||
def diagnostic_score(mode):
|
||||
joint = total = 0
|
||||
for kind, items in plan['diagnostic'].items():
|
||||
rows = json.loads((a.out/f'diagnostic-19-{mode}-{kind}.json').read_text())
|
||||
verify(tok, old['protocol'], items, rows, (mode,))
|
||||
correct = [row['arms'][mode]['correct'] for row in rows]
|
||||
joint += sum(x and y for x, y in zip(correct[::2], correct[1::2]))
|
||||
total += sum(correct)
|
||||
return joint, total
|
||||
|
||||
ranking = {mode: diagnostic_score(mode) for mode in ('baseline', 'read', 'send', 'both')}
|
||||
single = max(('read', 'send'), key=ranking.get)
|
||||
modes = ['baseline', 'read', 'send', 'both']
|
||||
decision = {'ranking': ranking, 'site': 19}
|
||||
if ranking[single] > ranking['baseline']:
|
||||
if single == 'read':
|
||||
groups = ['read-group-0', 'read-group-1']
|
||||
evaluate('diagnostic', 19, groups)
|
||||
scores = {group: diagnostic_score(group) for group in groups}
|
||||
decision.update(group_scores=scores, selected=max(groups, key=scores.get),
|
||||
random_group=random.Random(120203).choice(groups))
|
||||
modes.extend(groups)
|
||||
else:
|
||||
modes.append('send-permuted')
|
||||
decision['holdout_modes'] = modes
|
||||
selection = a.out/'selection.json'
|
||||
if selection.exists():
|
||||
assert json.loads(selection.read_text()) == json.loads(json.dumps(decision))
|
||||
else:
|
||||
write_json(selection, decision)
|
||||
evaluate('holdout', 19, modes)
|
||||
|
||||
if __name__=='__main__':
|
||||
main()
|
||||
@@ -0,0 +1,159 @@
|
||||
"""Summarize paired score interventions, resampling entire tables."""
|
||||
import argparse
|
||||
import json
|
||||
import math
|
||||
import random
|
||||
from pathlib import Path
|
||||
from statistics import mean
|
||||
|
||||
|
||||
def classify(question, row, mode):
|
||||
records, query = question['question'].split('.\n')
|
||||
table = dict(field.split('=') for field in records.removeprefix(
|
||||
'Records in time order: ').split(', '))
|
||||
target = query.removesuffix('?').split()[-1]
|
||||
assert len(table) == len(set(table.values())) == 12
|
||||
assert int(table[target]) == question['answer'] == row['gold']
|
||||
assert question['id'] == row['id']
|
||||
answer = row['arms'][mode]['answer']
|
||||
correct = answer == row['gold']
|
||||
assert correct == row['arms'][mode]['correct']
|
||||
other_key = next((k for k, v in table.items() if int(v) == answer and k != target), None)
|
||||
return dict(id=row['id'], answer=answer, correct=correct, target=target,
|
||||
wrong_key=other_key, outside_table=answer is not None and not correct and other_key is None,
|
||||
unparsable=answer is None)
|
||||
|
||||
|
||||
def table_metrics(items, rows, mode):
|
||||
assert len(items) == len(rows) and len(items) % 2 == 0
|
||||
classified = [classify(item, row, mode) for item, row in zip(items, rows)]
|
||||
metrics = []
|
||||
for i in range(0, len(rows), 2):
|
||||
pair = classified[i:i+2]
|
||||
probabilities = [row['first_digit_probability'] for row in rows[i:i+2]]
|
||||
assert all(math.isfinite(p) and 0 <= p <= 1 for p in probabilities)
|
||||
metrics.append(dict(correct=mean(r['correct'] for r in pair),
|
||||
both_correct=int(all(r['correct'] for r in pair)),
|
||||
wrong_key=mean(r['wrong_key'] is not None for r in pair),
|
||||
first_digit_probability=mean(probabilities)))
|
||||
return metrics, classified
|
||||
|
||||
|
||||
def interval(values, resamples):
|
||||
estimates = sorted(sum(values[i] for i in indices)/len(values) for indices in resamples)
|
||||
return dict(delta=mean(values), lower95=estimates[int(len(estimates)*.025)],
|
||||
upper95=estimates[math.ceil(len(estimates)*.975)-1])
|
||||
|
||||
|
||||
def summarize_arms(arms, contrasts, samples):
|
||||
first = next(iter(arms.values()))
|
||||
fields = first[0].keys()
|
||||
count = len(first)
|
||||
assert all(len(arm) == count for arm in arms.values())
|
||||
means = {m: {k: mean(row[k] for row in arm) for k in fields}
|
||||
for m, arm in arms.items()}
|
||||
comparisons = {}
|
||||
for name, coefficients in contrasts.items():
|
||||
comparisons[name] = {}
|
||||
for field in fields:
|
||||
differences = [sum(c * arms[m][i][field] for m, c in coefficients.items())
|
||||
for i in range(count)]
|
||||
comparisons[name][field] = interval(differences, samples)
|
||||
return dict(means=means, paired_contrasts=comparisons)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('directory', type=Path)
|
||||
parser.add_argument('--tokenizer', required=True, type=Path)
|
||||
parser.add_argument('--frozen', required=True, type=Path)
|
||||
args = parser.parse_args()
|
||||
from tokenizers import Tokenizer
|
||||
from crossqkv.lisa_full_answer import fingerprint, prompt
|
||||
from crossqkv.lisa_full_answer_verify import verify
|
||||
from functional.run import write_json
|
||||
protocol = json.loads(args.frozen.read_text())['protocol']
|
||||
assert fingerprint(args.tokenizer) == protocol['weights']['tokenizer.json']
|
||||
tokenizer = Tokenizer.from_file(str(args.tokenizer))
|
||||
assert fingerprint(args.directory/'protocol.json') == 'c309f8721534b1f229a00ff556b48495c4e074be45c1905389aa57e9e3ddb048'
|
||||
def read(name):
|
||||
return json.loads((args.directory/name).read_text())
|
||||
plan = read('protocol.json')
|
||||
questions = plan['holdout']
|
||||
modes = read('selection.json')['holdout_modes']
|
||||
n = len(questions['swap']) // 2
|
||||
assert n >= 32 and len(questions['query']) == 2*n
|
||||
rng = random.Random(120204)
|
||||
resamples = [rng.choices(range(n), k=n) for _ in range(10000)]
|
||||
tables, detail, summary = {}, {}, {}
|
||||
costs = {}
|
||||
for kind, prompts in questions.items():
|
||||
lengths = [len(tokenizer.encode(prompt(item['question']), add_special_tokens=False).ids)
|
||||
for item in prompts]
|
||||
costs[kind] = {}
|
||||
tables[kind], detail[kind] = {}, {}
|
||||
for mode in modes:
|
||||
rows = read(f'holdout-19-{mode}-{kind}.json')
|
||||
verify(tokenizer, protocol, prompts, rows, (mode,))
|
||||
positions = edges = 0
|
||||
for i in range(0, len(rows), 2):
|
||||
width = max(lengths[i:i+2])
|
||||
steps = max(len(r['arms'][mode]['tokens']) for r in rows[i:i+2]) - 1
|
||||
positions += 2 * (width + steps)
|
||||
edges += 2 * (width**2 + steps*width + steps*(steps+1)//2)
|
||||
costs[kind][mode] = dict(processed_positions=positions, computed_score_positions=edges,
|
||||
extra_native_projection_macs=0 if mode == 'baseline' else 9437184*positions,
|
||||
extra_native_score_macs=0 if mode == 'baseline' else 2048*edges)
|
||||
tables[kind][mode], detail[kind][mode] = table_metrics(prompts, rows, mode)
|
||||
fields = tables['swap']['baseline'][0].keys()
|
||||
tables['both_kinds'] = {
|
||||
mode: [{k: (s[k]+q[k])/2 for k in fields}
|
||||
for s, q in zip(tables['swap'][mode], tables['query'][mode])] for mode in modes}
|
||||
for kind, arms in tables.items():
|
||||
contrasts = {mode+'-baseline': {mode: 1, 'baseline': -1} for mode in modes if mode != 'baseline'}
|
||||
contrasts['interaction'] = {'both': 1, 'baseline': 1, 'read': -1, 'send': -1}
|
||||
if 'send-permuted' in modes:
|
||||
contrasts['send-permuted-control'] = {'send': 1, 'send-permuted': -1}
|
||||
if 'read-group-0' in modes:
|
||||
selected = read('selection.json')['selected']
|
||||
other = next(m for m in modes if m.startswith('read-group-') and m != selected)
|
||||
contrasts['selected-other'] = {selected: 1, other: -1}
|
||||
contrasts['selected-full-read'] = {selected: 1, 'read': -1}
|
||||
summary[kind] = summarize_arms(arms, contrasts, resamples)
|
||||
isolation = {}
|
||||
layer_comparison = {}
|
||||
for kind, prompts in plan['diagnostic'].items():
|
||||
arms = {}
|
||||
for mode in ('native', 'only-15', 'only-19', 'both-15-19'):
|
||||
rows = read(f'diagnostic-isolation-{mode}-{kind}.json')
|
||||
verify(tokenizer, protocol, prompts, rows, (mode,))
|
||||
arms[mode], _ = table_metrics(prompts, rows, mode)
|
||||
count = len(prompts)//2
|
||||
diagnostic_rng = random.Random(120205)
|
||||
samples = [diagnostic_rng.choices(range(count), k=count) for _ in range(10000)]
|
||||
combinations = {
|
||||
'only-15-minus-native': {'only-15': 1, 'native': -1},
|
||||
'only-19-minus-native': {'only-19': 1, 'native': -1},
|
||||
'joint-interaction': {'both-15-19': 1, 'only-19': -1, 'only-15': -1, 'native': 1}}
|
||||
isolation[kind] = summarize_arms(arms, combinations, samples)
|
||||
arms = {}
|
||||
for site, mode in [(19, 'baseline')] + [(s, m) for s in (15, 19)
|
||||
for m in ('both', 'read', 'send')]:
|
||||
rows = read(f'diagnostic-{site}-{mode}-{kind}.json')
|
||||
verify(tokenizer, protocol, prompts, rows, (mode,))
|
||||
label = 'baseline' if mode == 'baseline' else f'{site}-{mode}'
|
||||
arms[label], _ = table_metrics(prompts, rows, mode)
|
||||
comparisons = {f'19-minus-15-{m}': {f'19-{m}': 1, f'15-{m}': -1}
|
||||
for m in ('read', 'send', 'both')}
|
||||
for site in (15, 19):
|
||||
comparisons[f'{site}-interaction'] = {
|
||||
f'{site}-both': 1, 'baseline': 1, f'{site}-read': -1, f'{site}-send': -1}
|
||||
layer_comparison[kind] = summarize_arms(arms, comparisons, samples)
|
||||
write_json(args.directory/'audit.json', dict(
|
||||
tables=n, bootstrap_seed=120204, bootstrap_replicates=len(resamples),
|
||||
summary=summary, answers=detail, costs=costs, diagnostic_isolation=isolation,
|
||||
diagnostic_site_comparison=layer_comparison))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,190 @@
|
||||
"""Differentiable Qwen text tail with streamed frozen weights and LiSA sites."""
|
||||
import math
|
||||
|
||||
import torch
|
||||
from torch import nn
|
||||
from torch.nn import functional as F
|
||||
from torch.utils.checkpoint import checkpoint
|
||||
|
||||
from crossqkv.lisa_train import causal_attention
|
||||
from functional.model import PREFIX
|
||||
|
||||
|
||||
def weight_chunks(tensor, start, end, rows=512):
|
||||
width = tensor.shape[1]
|
||||
for lo in range(start, end, rows):
|
||||
hi = min(lo + rows, end)
|
||||
yield torch.from_numpy(tensor.read(slice(lo * width, hi * width)).reshape(hi-lo, width))
|
||||
tensor.evict()
|
||||
|
||||
|
||||
class FrozenLinear(torch.autograd.Function):
|
||||
"""Read only the requested output rows and stream them again for dX."""
|
||||
|
||||
@staticmethod
|
||||
def forward(ctx, hidden, weight, start, end):
|
||||
ctx.weight, ctx.start, ctx.end = weight, start, end
|
||||
return torch.cat([F.linear(hidden, w) for w in weight_chunks(weight, start, end)], dim=-1)
|
||||
|
||||
@staticmethod
|
||||
def backward(ctx, grad):
|
||||
out = grad.new_zeros((*grad.shape[:-1], ctx.weight.shape[1]))
|
||||
lo = 0
|
||||
for w in weight_chunks(ctx.weight, ctx.start, ctx.end):
|
||||
hi = lo + len(w)
|
||||
out = out + grad[..., lo:hi] @ w
|
||||
lo = hi
|
||||
return out, None, None, None
|
||||
|
||||
|
||||
def rotate(x, theta, fraction, positions=None):
|
||||
d = int(x.shape[-1] * fraction)
|
||||
inv = theta ** (-torch.arange(0, d, 2, dtype=x.dtype, device=x.device) / d)
|
||||
if positions is None:
|
||||
positions = torch.arange(x.shape[1], dtype=x.dtype, device=x.device)[None, :]
|
||||
phase = positions[..., None] * inv
|
||||
angle = torch.cat((phase, phase), dim=-1).unsqueeze(-2)
|
||||
a, b = x[..., :d].chunk(2, dim=-1)
|
||||
return torch.cat((x[..., :d] * angle.cos() + torch.cat((-b, a), -1) * angle.sin(),
|
||||
x[..., d:]), dim=-1)
|
||||
|
||||
|
||||
def gated_delta_chunk(q, k, v, g, beta, state=None):
|
||||
q = q * (q.square().sum(-1, keepdim=True) + 1e-6).rsqrt() / math.sqrt(q.shape[-1])
|
||||
k = k * (k.square().sum(-1, keepdim=True) + 1e-6).rsqrt()
|
||||
if state is None:
|
||||
state = v.new_zeros(v.shape[0], v.shape[2], k.shape[-1], v.shape[-1])
|
||||
rows = []
|
||||
for i in range(v.shape[1]):
|
||||
qt, kt, vt = q[:, i], k[:, i], v[:, i]
|
||||
state = state * g[:, i, :, None, None].exp()
|
||||
delta = (vt - (state * kt.unsqueeze(-1)).sum(-2)) * beta[:, i, :, None]
|
||||
state = state + kt.unsqueeze(-1) * delta.unsqueeze(-2)
|
||||
rows.append((state * qt.unsqueeze(-1)).sum(-2))
|
||||
return torch.stack(rows, dim=1), state
|
||||
|
||||
|
||||
def gated_delta(q, k, v, g, beta):
|
||||
return gated_delta_chunk(q, k, v, g, beta)[0]
|
||||
|
||||
|
||||
class TorchTail(nn.Module):
|
||||
"""Inputs start immediately before the first trainable recipient."""
|
||||
|
||||
def __init__(self, source_model, start, adapters=None):
|
||||
super().__init__()
|
||||
self.source = source_model
|
||||
self.c = source_model.config
|
||||
self.eps = source_model.eps
|
||||
self.start = start
|
||||
self.adapters = nn.ModuleDict({str(k): v for k, v in (adapters or {}).items()})
|
||||
self._small = {}
|
||||
|
||||
def small(self, name):
|
||||
if name not in self._small:
|
||||
self._small[name] = torch.from_numpy(self.source.small(name))
|
||||
return self._small[name]
|
||||
|
||||
def linear(self, h, name, start=0, end=None):
|
||||
t = self.source.tensors[PREFIX + name + '.weight']
|
||||
return FrozenLinear.apply(h, t, start, t.shape[0] if end is None else end)
|
||||
|
||||
def norm(self, x, name, centered=True):
|
||||
w = self.small(name + '.weight')
|
||||
return x * (x.square().mean(-1, keepdim=True) + self.eps).rsqrt() * (1+w if centered else w)
|
||||
|
||||
def gate_only(self, h, name):
|
||||
heads, dim = self.c['num_attention_heads'], self.c['head_dim']
|
||||
return torch.stack([self.linear(h, name+'q_proj', (2*j+1)*dim, (2*j+2)*dim)
|
||||
for j in range(heads)], dim=2)
|
||||
|
||||
def native_scores(self, q, h, name):
|
||||
c = self.c
|
||||
k = self.linear(h, name+'k_proj').unflatten(-1, (c['num_key_value_heads'], c['head_dim']))
|
||||
params = c['rope_parameters']
|
||||
q = rotate(self.norm(q, name+'q_norm'), params['rope_theta'], params['partial_rotary_factor'])
|
||||
k = rotate(self.norm(k, name+'k_norm'), params['rope_theta'], params['partial_rotary_factor'])
|
||||
k = k.repeat_interleave(q.shape[2] // k.shape[2], dim=2)
|
||||
return torch.einsum('bthd,bshd->bhts', q, k) / math.sqrt(q.shape[-1])
|
||||
|
||||
def full(self, h, layer, donor, lengths, mode, recipients, keep_teacher):
|
||||
c = self.c
|
||||
heads, kv_heads, dim = c['num_attention_heads'], c['num_key_value_heads'], c['head_dim']
|
||||
name = f'layers.{layer}.self_attn.'
|
||||
shared = layer in recipients and mode != 'native'
|
||||
if not shared or keep_teacher:
|
||||
packed = self.linear(h, name+'q_proj').unflatten(-1, (heads, 2*dim))
|
||||
q, gate = packed.chunk(2, dim=-1)
|
||||
if shared:
|
||||
with torch.no_grad():
|
||||
native = self.native_scores(q, h, name)
|
||||
else:
|
||||
native = self.native_scores(q, h, name)
|
||||
else:
|
||||
gate = self.gate_only(h, name)
|
||||
native = None
|
||||
if not shared:
|
||||
scores = native
|
||||
elif mode == 'direct':
|
||||
scores = donor
|
||||
elif mode == 'lisa':
|
||||
pos = torch.arange(h.shape[1], device=h.device)[None, :]
|
||||
scores = self.adapters[str(layer)](h, donor, pos)
|
||||
elif mode == 'linear':
|
||||
matrix = self.adapters[str(layer)]
|
||||
scores = matrix(donor.permute(0, 2, 3, 1)).permute(0, 3, 1, 2)
|
||||
else:
|
||||
raise ValueError(f'Unknown mode {mode}')
|
||||
v = self.linear(h, name+'v_proj').unflatten(-1, (kv_heads, dim))
|
||||
out = causal_attention(scores, v, lengths) * gate.sigmoid()
|
||||
return self.linear(out.flatten(-2), name+'o_proj'), scores, native
|
||||
|
||||
def linear_attention(self, x, layer):
|
||||
return self.linear_attention_chunk(x, layer)[0]
|
||||
|
||||
def linear_attention_chunk(self, x, layer, previous=None):
|
||||
p = f'layers.{layer}.linear_attn.'
|
||||
c = self.c
|
||||
kh, vh = c['linear_num_key_heads'], c['linear_num_value_heads']
|
||||
kd, vd = c['linear_key_head_dim'], c['linear_value_head_dim']
|
||||
projected = self.linear(x, p+'in_proj_qkv').transpose(1, 2)
|
||||
kernel = self.small(p+'conv1d.weight')
|
||||
history = kernel.shape[-1] - 1
|
||||
if previous is None:
|
||||
projected = F.pad(projected, (history, 0))
|
||||
state = None
|
||||
else:
|
||||
prefix, state = previous
|
||||
projected = torch.cat((prefix, projected), dim=-1)
|
||||
convolved = F.conv1d(projected, kernel, groups=projected.shape[1])
|
||||
q, k, v = F.silu(convolved.transpose(1, 2)).split((kh*kd, kh*kd, vh*vd), dim=-1)
|
||||
q = q.unflatten(-1, (kh, kd)).repeat_interleave(vh//kh, dim=2)
|
||||
k = k.unflatten(-1, (kh, kd)).repeat_interleave(vh//kh, dim=2)
|
||||
v = v.unflatten(-1, (vh, vd))
|
||||
gate = self.linear(x, p+'in_proj_z').unflatten(-1, (vh, vd))
|
||||
beta = self.linear(x, p+'in_proj_b').sigmoid()
|
||||
a = self.linear(x, p+'in_proj_a')
|
||||
g = -self.small(p+'A_log').exp() * F.softplus(a + self.small(p+'dt_bias'))
|
||||
out, state = gated_delta_chunk(q, k, v, g, beta, state)
|
||||
output = self.linear((self.norm(out, p+'norm', centered=False)*F.silu(gate)).flatten(-2),
|
||||
p+'out_proj')
|
||||
return output, (projected[..., projected.shape[-1]-history:].clone(), state)
|
||||
|
||||
def forward(self, h, donor, lengths, mode, recipients, keep_teacher=False):
|
||||
side = {}
|
||||
for layer, kind in enumerate(self.c['layer_types'][self.start:], self.start):
|
||||
p = f'layers.{layer}.'
|
||||
n = self.norm(h, p+'input_layernorm')
|
||||
if kind == 'full_attention':
|
||||
out, donor, native = self.full(n, layer, donor, lengths, mode, recipients,
|
||||
keep_teacher)
|
||||
side[layer] = (donor, native)
|
||||
elif torch.is_grad_enabled() and n.requires_grad:
|
||||
out = checkpoint(self.linear_attention, n, layer, use_reentrant=True)
|
||||
else:
|
||||
out = self.linear_attention(n, layer)
|
||||
h = h + out
|
||||
n = self.norm(h, p+'post_attention_layernorm')
|
||||
x = F.silu(self.linear(n, p+'mlp.gate_proj')) * self.linear(n, p+'mlp.up_proj')
|
||||
h = h + self.linear(x, p+'mlp.down_proj')
|
||||
return self.norm(h, 'norm'), side
|
||||
@@ -0,0 +1,126 @@
|
||||
"""Trainable LiSA attention adaptor for the Qwen text reference."""
|
||||
import math
|
||||
|
||||
import torch
|
||||
from torch import nn
|
||||
from torch.nn import functional as F
|
||||
|
||||
|
||||
class LearnableSharingAttention(nn.Module):
|
||||
"""Map low-rank local scores and donor logits to recipient logits."""
|
||||
|
||||
def __init__(self, hidden_size, heads, kv_heads, rank, theta, rotary_fraction,
|
||||
width=256, bias=False):
|
||||
super().__init__()
|
||||
rotary_dim = int(rank * rotary_fraction)
|
||||
if heads % kv_heads or not 0 < rotary_dim <= rank or rotary_dim % 2:
|
||||
raise ValueError('Expected grouped query heads and a positive even rotary dimension')
|
||||
self.heads, self.kv_heads, self.rank = heads, kv_heads, rank
|
||||
self.rotary_dim = rotary_dim
|
||||
inv_freq = theta ** (-torch.arange(0, rotary_dim, 2, dtype=torch.float32) / rotary_dim)
|
||||
self.register_buffer('inv_freq', inv_freq, persistent=False)
|
||||
self.q_proj = nn.Linear(hidden_size, heads * rank, bias=bias)
|
||||
self.k_proj = nn.Linear(hidden_size, kv_heads * rank, bias=bias)
|
||||
self.fuse = nn.Sequential(nn.Linear(2 * heads, width, bias=bias), nn.ReLU(),
|
||||
nn.Linear(width, heads, bias=bias))
|
||||
|
||||
def rotate(self, x, position_ids):
|
||||
phase = position_ids[..., None] * self.inv_freq
|
||||
angle = torch.cat((phase, phase), dim=-1).unsqueeze(2)
|
||||
a, b = x[..., :self.rotary_dim].chunk(2, dim=-1)
|
||||
first = torch.cat((a, b), dim=-1)
|
||||
rotated = torch.cat((-b, a), dim=-1)
|
||||
return torch.cat((first * angle.cos() + rotated * angle.sin(),
|
||||
x[..., self.rotary_dim:]), dim=-1)
|
||||
|
||||
def forward(self, hidden, donor, position_ids):
|
||||
b, t, _ = hidden.shape
|
||||
q = self.rotate(self.q_proj(hidden).reshape(b, t, self.heads, self.rank), position_ids)
|
||||
k = self.rotate(self.k_proj(hidden).reshape(b, t, self.kv_heads, self.rank), position_ids)
|
||||
k = k.repeat_interleave(self.heads // self.kv_heads, dim=2)
|
||||
delta = torch.einsum('bthd,bshd->btsh', q, k) / math.sqrt(self.rank)
|
||||
return self.fuse(torch.cat((delta, donor.permute(0, 2, 3, 1)), dim=-1)).permute(0, 3, 1, 2)
|
||||
|
||||
|
||||
def causal_attention(scores, values, lengths):
|
||||
"""Apply recipient values after causal masking of the fused scores."""
|
||||
positions = torch.arange(scores.shape[-1], device=scores.device)
|
||||
valid = positions[None, :] < lengths[:, None]
|
||||
causal = positions[:, None] >= positions[None, :]
|
||||
allowed = valid[:, None, None, :] & causal
|
||||
p = scores.masked_fill(~allowed, -torch.inf).softmax(dim=-1)
|
||||
repeats = scores.shape[1] // values.shape[2]
|
||||
return torch.einsum('bhts,bshd->bthd', p, values.repeat_interleave(repeats, dim=2))
|
||||
|
||||
|
||||
def huber_distillation(scores, teacher, lengths):
|
||||
"""Use raw pre-softmax scores and exclude sequence padding."""
|
||||
positions = torch.arange(scores.shape[-1], device=scores.device)
|
||||
valid = positions[None, :] < lengths[:, None]
|
||||
pairs = valid[:, None, :, None] & valid[:, None, None, :]
|
||||
return F.huber_loss(scores.masked_select(pairs), teacher.detach().masked_select(pairs),
|
||||
delta=1.0)
|
||||
|
||||
|
||||
def objective(scores, teacher, lengths, language_model_loss):
|
||||
kd = huber_distillation(scores, teacher, lengths)
|
||||
return 0.25 * kd + 0.75 * language_model_loss, kd
|
||||
|
||||
|
||||
class FrozenRecipient(nn.Module):
|
||||
"""The recipient's unchanged gated output projection, MLP and final norm."""
|
||||
|
||||
def __init__(self, weights, eps):
|
||||
super().__init__()
|
||||
for key in ('o', 'post', 'gate', 'up', 'down', 'final'):
|
||||
self.register_buffer('w_' + key, torch.as_tensor(weights[key]).detach())
|
||||
self.eps = eps
|
||||
|
||||
def norm(self, hidden, weight):
|
||||
return hidden * (hidden.square().mean(dim=-1, keepdim=True) + self.eps).rsqrt() * (1 + weight)
|
||||
|
||||
def forward(self, context, gate, residual):
|
||||
h = residual + F.linear((context * gate.sigmoid()).flatten(-2), self.w_o)
|
||||
n = self.norm(h, self.w_post)
|
||||
h = h + F.linear(F.silu(F.linear(n, self.w_gate)) * F.linear(n, self.w_up), self.w_down)
|
||||
return self.norm(h, self.w_final)
|
||||
|
||||
|
||||
class _FrozenVocabularyCE(torch.autograd.Function):
|
||||
"""Exact full-vocabulary CE with a streamed frozen head in both passes."""
|
||||
|
||||
@staticmethod
|
||||
def forward(ctx, hidden, targets, weights, vocabulary):
|
||||
log_total = hidden.new_full((hidden.shape[0],), -torch.inf)
|
||||
selected = hidden.new_zeros(hidden.shape[0])
|
||||
for start, w in vocabulary():
|
||||
logits = F.linear(hidden, w)
|
||||
log_total = torch.logaddexp(log_total, logits.logsumexp(dim=-1))
|
||||
belongs = (targets >= start) & (targets < start + w.shape[0])
|
||||
selected[belongs] = logits[belongs, targets[belongs] - start]
|
||||
ctx.save_for_backward(hidden, targets, log_total, weights)
|
||||
ctx.vocabulary = vocabulary
|
||||
return ((log_total - selected) * weights).sum() / weights.sum()
|
||||
|
||||
@staticmethod
|
||||
def backward(ctx, gradient):
|
||||
hidden, targets, log_total, weights = ctx.saved_tensors
|
||||
grad_hidden = torch.zeros_like(hidden)
|
||||
for start, w in ctx.vocabulary():
|
||||
probs = (F.linear(hidden, w) - log_total[:, None]).exp()
|
||||
belongs = (targets >= start) & (targets < start + w.shape[0])
|
||||
probs[belongs, targets[belongs] - start] -= 1
|
||||
grad_hidden.addmm_(probs, w)
|
||||
return grad_hidden * (gradient * weights[:, None] / weights.sum()), None, None, None
|
||||
|
||||
|
||||
def language_model_loss(hidden, ids, lengths, vocabulary, answer_weight=1.0,
|
||||
completion_starts=None):
|
||||
"""Train on all valid next-token targets, avoiding padding and final positions."""
|
||||
positions = torch.arange(ids.shape[1] - 1, device=ids.device)
|
||||
valid = positions[None, :] + 1 < lengths[:, None]
|
||||
if completion_starts is not None:
|
||||
valid = valid & (positions[None, :] + 1 >= completion_starts[:, None])
|
||||
weights = torch.where(positions[None, :] + 2 == lengths[:, None], answer_weight, 1.0)
|
||||
return _FrozenVocabularyCE.apply(hidden[:, :-1][valid], ids[:, 1:][valid],
|
||||
weights[valid].to(dtype=hidden.dtype), vocabulary)
|
||||
@@ -0,0 +1,169 @@
|
||||
"""Test a single predeclared shrinkage of the two trained LiSA distillation updates."""
|
||||
import argparse
|
||||
import fcntl
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
from tokenizers import Tokenizer
|
||||
|
||||
from crossqkv.lisa_combination_screen import ADAPTER_SHA, SITES
|
||||
from crossqkv.lisa_full_answer import fingerprint
|
||||
from crossqkv.lisa_full_answer_train import checkpoint, load_locked
|
||||
from crossqkv.lisa_full_answer_verify import verify
|
||||
from crossqkv.lisa_rank_compare import make_adapters
|
||||
from crossqkv.lisa_trajectory_train import validate_checkpoint
|
||||
from functional.model import StreamingLM
|
||||
from functional.run import write_json
|
||||
|
||||
|
||||
PROTOCOL_SHA = '6858dbc64db0b989e8112e9dbea70662a2a05f66f11b180e8f2c668c74c43aef'
|
||||
TRAINED_SHA = {
|
||||
'student': '7faacdffbc81d0c786ef0c7a5acaf1724d82af155fed7b834dabc73dcf91f3a4',
|
||||
'reference': '21ae007cb7343c1a0042655824bdc98ee2f03071d5f5dc43dbc8b441a262d84f',
|
||||
}
|
||||
VALIDATION_SHA = {
|
||||
'prior-lisa': '3a10cdd0a22e110b5468ba496c3440a8b510ab3595328df330e7ea02b0ccbb76',
|
||||
'trajectory-student': 'af213ef477e99780d48b995f8a1d07ada6409bd70011202fb73db56247199c5f',
|
||||
'trajectory-reference': '3b5557336570cbeb1f6a592013780dc3e00e7f29b4192d59c53c6b2493779b91',
|
||||
}
|
||||
|
||||
|
||||
def read(path):
|
||||
return json.loads(path.read_bytes())
|
||||
|
||||
|
||||
def midpoint(base, trained):
|
||||
if base.keys() != trained.keys():
|
||||
raise ValueError('Adapter parameter names differ')
|
||||
result = {}
|
||||
for name, old in base.items():
|
||||
new = trained[name]
|
||||
if new.shape != old.shape or new.dtype != old.dtype or not old.is_floating_point():
|
||||
raise ValueError(f'Incompatible parameters for {name}')
|
||||
value = ((old.double() + new.double()) * 0.5).to(old.dtype)
|
||||
if not torch.isfinite(value).all():
|
||||
raise ValueError(f'Nonfinite midpoint for {name}')
|
||||
result[name] = value
|
||||
return result
|
||||
|
||||
|
||||
def prepare(prior, out, directory):
|
||||
base_path = prior / 'final/lisa.pt'
|
||||
if fingerprint(base_path) != ADAPTER_SHA:
|
||||
raise ValueError('Wrong starting LiSA model')
|
||||
base = torch.load(base_path, weights_only=True, map_location='cpu')
|
||||
spec = {'protocol_sha256': PROTOCOL_SHA, 'base_sha256': ADAPTER_SHA, 'fraction': 0.5,
|
||||
'parameters': sum(t.numel() for t in base.values()), 'endpoints': {}}
|
||||
for prefix, digest in TRAINED_SHA.items():
|
||||
endpoint = out / ('trajectory-' + prefix) / 'adapter.pt'
|
||||
if fingerprint(endpoint) != digest:
|
||||
raise ValueError(f'Wrong {prefix} distillation checkpoint')
|
||||
value = midpoint(base, torch.load(endpoint, weights_only=True, map_location='cpu'))
|
||||
path = directory / (prefix + '.pt')
|
||||
if path.exists():
|
||||
saved = torch.load(path, weights_only=True, map_location='cpu')
|
||||
if saved.keys() != value.keys() or any(not torch.equal(t, saved[k]) for k, t in value.items()):
|
||||
raise ValueError(f'Stored {prefix} midpoint differs from its endpoints')
|
||||
else:
|
||||
checkpoint(path, value)
|
||||
spec['endpoints'][prefix] = {'trained_sha256': digest, 'midpoint_sha256': fingerprint(path)}
|
||||
path = directory / 'spec.json'
|
||||
if path.exists() and read(path) != spec:
|
||||
raise ValueError('Midpoint experiment specification changed')
|
||||
write_json(path, spec)
|
||||
return spec
|
||||
|
||||
|
||||
def summarize(questions, answers, *, intervals):
|
||||
ids = [q['id'] for q in questions]
|
||||
flags = {name: np.array([a['correct'] for a in rows], dtype=int).reshape(-1, 2)
|
||||
for name, rows in answers.items()}
|
||||
draws = np.random.default_rng(72505).integers(0, len(ids)//2, (10000, len(ids)//2)) if intervals else None
|
||||
comparisons = {}
|
||||
for prefix in TRAINED_SHA:
|
||||
name = 'half-' + prefix
|
||||
controls = ['prior-lisa', 'trajectory-' + prefix]
|
||||
if prefix == 'student':
|
||||
controls.append('half-reference')
|
||||
for control in controls:
|
||||
delta = flags[name] - flags[control]
|
||||
comparison = {'delta': float(delta.mean()),
|
||||
'corrected': [q for q, d in zip(ids, delta.flat) if d > 0],
|
||||
'lost': [q for q, d in zip(ids, delta.flat) if d < 0]}
|
||||
if intervals:
|
||||
comparison['interval_95'] = np.quantile(delta.mean(1)[draws].mean(1), [.025, .975]).tolist()
|
||||
comparisons[name + '-vs-' + control] = comparison
|
||||
return {'questions': len(ids), 'correct': {k: int(v.sum()) for k, v in flags.items()},
|
||||
'pairs_both_correct': {k: int(v.all(1).sum()) for k, v in flags.items()}, 'comparisons': comparisons}
|
||||
|
||||
|
||||
def score_split(args, directory, questions, split, protocol, model, tok, spec):
|
||||
folder = directory / split
|
||||
folder.mkdir(exist_ok=True)
|
||||
answers = {}
|
||||
for name, digest in VALIDATION_SHA.items():
|
||||
prefix = name.removeprefix('trajectory-')
|
||||
if split == 'validation':
|
||||
path = (args.out/'validation-prior-lisa.json' if name == 'prior-lisa'
|
||||
else args.out/name/('validation-' + prefix + '.json'))
|
||||
if fingerprint(path) != digest:
|
||||
raise ValueError(f'Validation control changed for {name}')
|
||||
else:
|
||||
path = args.out/'holdout'/(name + '.json')
|
||||
expected = ADAPTER_SHA if name == 'prior-lisa' else TRAINED_SHA[prefix]
|
||||
if read(path.with_name(name + '-source.json')) != expected:
|
||||
raise ValueError(f'Holdout control source changed for {name}')
|
||||
rows = read(path)
|
||||
verify(tok, protocol, questions, rows, (path.stem,))
|
||||
answers[name] = [r['arms'][path.stem] for r in rows]
|
||||
for prefix in TRAINED_SHA:
|
||||
name = 'half-' + prefix
|
||||
path = directory / (prefix + '.pt')
|
||||
if fingerprint(path) != spec['endpoints'][prefix]['midpoint_sha256']:
|
||||
raise ValueError(f'Midpoint changed for {prefix}')
|
||||
adapters = make_adapters(model.config, dict.fromkeys(SITES, 40), True)
|
||||
torch.nn.ModuleDict({str(i): v for i, v in adapters.items()}).load_state_dict(
|
||||
torch.load(path, weights_only=True, map_location='cpu'))
|
||||
answer_path = folder / (name + '.json')
|
||||
validate_checkpoint(model, tok, adapters, questions, protocol, answer_path, split_name=split)
|
||||
rows = read(answer_path)
|
||||
verify(tok, protocol, questions, rows, (name,))
|
||||
answers[name] = [r['arms'][name] for r in rows]
|
||||
summary = summarize(questions, answers, intervals=split == 'test')
|
||||
write_json(folder/'summary.json', summary)
|
||||
return summary
|
||||
|
||||
|
||||
def run(args):
|
||||
if fingerprint(args.out/'protocol.json') != PROTOCOL_SHA:
|
||||
raise ValueError('Wrong comparison protocol')
|
||||
directory = args.out/'trajectory-midpoint'
|
||||
directory.mkdir(exist_ok=True)
|
||||
with (directory/'.lock').open('a') as lock:
|
||||
fcntl.flock(lock, fcntl.LOCK_EX)
|
||||
spec = prepare(args.prior, args.out, directory)
|
||||
if args.prepare_only:
|
||||
return
|
||||
_, prior = load_locked(args.source, args.prior)
|
||||
model = StreamingLM(args.source/'weights', read(args.source/'model_config.json'), seconds=172800,
|
||||
process_swap_limit_kib=None)
|
||||
tok = Tokenizer.from_file(str(args.source/'tokenizer.json'))
|
||||
splits = read(args.out/'protocol.json')['splits']
|
||||
val = score_split(args, directory, splits['validation'], 'validation', prior['protocol'], model, tok, spec)
|
||||
counts = val['correct']
|
||||
qualified = [p for p in TRAINED_SHA if counts['half-' + p] > counts['prior-lisa']]
|
||||
if qualified:
|
||||
score_split(args, directory, splits['test'], 'test', prior['protocol'], model, tok, spec)
|
||||
write_json(directory/'decision.json', {'qualified_validation_prefixes': qualified,
|
||||
'test_evaluated': bool(qualified)})
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
for key in ('source', 'prior', 'out'):
|
||||
parser.add_argument('--' + key, required=True, type=Path)
|
||||
parser.add_argument('--prepare-only', action='store_true')
|
||||
torch.set_num_threads(1)
|
||||
run(parser.parse_args())
|
||||
@@ -0,0 +1,183 @@
|
||||
"""Distill next-token distributions along LiSA's current greedy trajectories."""
|
||||
import argparse
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
from tokenizers import Tokenizer
|
||||
|
||||
from crossqkv.lisa_combination_screen import ADAPTER_SHA, SITES
|
||||
from crossqkv.lisa_full_answer import STOP_TEXT, evaluate, fingerprint, prompt
|
||||
from crossqkv.lisa_full_answer_train import FitCapture, checkpoint, load_locked, verified_fit_captures
|
||||
from crossqkv.lisa_full_answer_verify import verify
|
||||
from crossqkv.lisa_tail import TorchTail, weight_chunks
|
||||
from crossqkv.lisa_train import LearnableSharingAttention
|
||||
from functional.model import PREFIX, StreamingLM
|
||||
from functional.run import write_json
|
||||
|
||||
|
||||
def reverse_kl(student, teacher, chunks):
|
||||
"""Exact reverse KL and its first derivative for a streamed, frozen head."""
|
||||
with torch.no_grad():
|
||||
# Both models use the same frozen output weights. Read each block once
|
||||
# for the two projections, then revisit it only for the student gradient.
|
||||
student_logits = []
|
||||
teacher_logits = []
|
||||
for w in chunks():
|
||||
student_logits.append(student @ w.T)
|
||||
teacher_logits.append(teacher @ w.T)
|
||||
logp = torch.cat(student_logits, dim=-1).log_softmax(-1)
|
||||
del student_logits
|
||||
logq = torch.cat(teacher_logits, dim=-1).log_softmax(-1)
|
||||
del teacher_logits
|
||||
diff = logp - logq
|
||||
prob = logp.exp()
|
||||
kl = (prob * diff).sum(-1, keepdim=True)
|
||||
dlogits = prob * (diff - kl) / len(student)
|
||||
grad = torch.zeros_like(student)
|
||||
start = 0
|
||||
for w in chunks():
|
||||
grad.addmm_(dlogits[:, start:start+len(w)], w)
|
||||
start += len(w)
|
||||
return kl.mean() + ((student - student.detach()) * grad).sum()
|
||||
|
||||
|
||||
@torch.no_grad()
|
||||
def full_teacher_inputs(model, teacher, ids, lengths):
|
||||
hidden = torch.from_numpy(model.embedding(ids.numpy()))
|
||||
target, maps = teacher(hidden, None, lengths, 'native', ())
|
||||
return target, teacher.residual, maps[SITES[0]-4][0]
|
||||
|
||||
|
||||
@torch.no_grad()
|
||||
def replay_teacher_inputs(tail, path, ids, start, lengths):
|
||||
with np.load(path, allow_pickle=False) as saved:
|
||||
if int(saved['start'].item()) != start or not np.array_equal(saved['ids'], ids.numpy()):
|
||||
raise ValueError('Cached sequence does not match this gold answer and prompt')
|
||||
residual = torch.from_numpy(saved['residual'])
|
||||
donor = torch.from_numpy(saved['donor'])
|
||||
target, _ = tail(residual, donor, lengths, 'native', ())
|
||||
return target, residual, donor
|
||||
|
||||
|
||||
def validate_checkpoint(model, tokenizer, adapters, questions, decode_spec, path, *, split_name='validation'):
|
||||
label = path.stem
|
||||
rows = json.loads(path.read_text()) if path.exists() else []
|
||||
if rows:
|
||||
verify(tokenizer, decode_spec, questions, rows, (label,), allow_prefix=True)
|
||||
for start in range(len(rows), len(questions), 2):
|
||||
batch = questions[start:start+2]
|
||||
outputs = evaluate(model, tokenizer, batch, {label: SITES}, adapters)
|
||||
verify(tokenizer, decode_spec, batch, outputs, (label,))
|
||||
rows.extend(outputs)
|
||||
write_json(path, rows)
|
||||
correct = sum(row['arms'][label]['correct'] for row in rows)
|
||||
print(label, split_name, 'correct', correct, '/', len(rows), flush=True)
|
||||
|
||||
|
||||
def main():
|
||||
p = argparse.ArgumentParser(description=__doc__)
|
||||
for name in ('source', 'prior', 'out'):
|
||||
p.add_argument('--'+name, required=True, type=Path)
|
||||
p.add_argument('--prefix', choices=('student', 'reference'), required=True)
|
||||
args = p.parse_args()
|
||||
torch.set_num_threads(1)
|
||||
torch.manual_seed(72504)
|
||||
_, prior = load_locked(args.source, args.prior)
|
||||
tasks = [x for x in prior['problems']['fit'] if x['task']=='lookup']
|
||||
protocol = args.out/'protocol.json'
|
||||
if fingerprint(protocol) != '6858dbc64db0b989e8112e9dbea70662a2a05f66f11b180e8f2c668c74c43aef':
|
||||
raise ValueError('Unknown combination study protocol')
|
||||
validation = json.loads(protocol.read_text())['splits']['validation']
|
||||
old = args.prior/'final/lisa.pt'
|
||||
if fingerprint(old) != ADAPTER_SHA:
|
||||
raise ValueError('Unknown baseline checkpoint')
|
||||
directory = args.out/('trajectory-'+args.prefix)
|
||||
directory.mkdir(exist_ok=True)
|
||||
config = json.loads((args.source/'model_config.json').read_text())
|
||||
model = StreamingLM(args.source/'weights', config, seconds=172800, process_swap_limit_kib=None)
|
||||
c = model.config
|
||||
rope = c['rope_parameters']
|
||||
adapters = {i: LearnableSharingAttention(c['hidden_size'], c['num_attention_heads'],
|
||||
c['num_key_value_heads'], 40, rope['rope_theta'], rope['partial_rotary_factor'],
|
||||
bias=c.get('attention_bias', False)) for i in SITES}
|
||||
tail = TorchTail(model, SITES[0], adapters)
|
||||
tail.adapters.load_state_dict(torch.load(old, weights_only=True))
|
||||
teacher = FitCapture(model, 0)
|
||||
teacher.sites = SITES
|
||||
opt = torch.optim.AdamW(tail.parameters(), lr=0.0001, weight_decay=0.1)
|
||||
tok = Tokenizer.from_file(str(args.source/'tokenizer.json'))
|
||||
if args.prefix == 'student':
|
||||
validate_checkpoint(model, tok, adapters, validation, prior['protocol'],
|
||||
args.out/'validation-prior-lisa.json')
|
||||
statefile = directory/'resume.pt'
|
||||
rows = []
|
||||
if statefile.exists():
|
||||
state = torch.load(statefile, weights_only=True)
|
||||
rows = state['rows']
|
||||
tail.adapters.load_state_dict(state['weights'])
|
||||
opt.load_state_dict(state['optimizer'])
|
||||
if [r['id'] for r in rows] != [x['id'] for x in tasks[:len(rows)]]:
|
||||
raise ValueError('Training prefix mismatch')
|
||||
embedding = model.tensors[PREFIX+'embed_tokens.weight']
|
||||
|
||||
def chunks():
|
||||
yield from weight_chunks(embedding, 0, embedding.shape[0], rows=1024)
|
||||
|
||||
captures = {}
|
||||
final = args.prior/'final'
|
||||
if args.prefix == 'reference' and (final/'verified-fit-capture.json').is_file():
|
||||
try:
|
||||
captures = verified_fit_captures(final, tasks)
|
||||
except (OSError, ValueError, KeyError) as exc:
|
||||
print('Using full native forward for reference prefixes:', exc, flush=True)
|
||||
|
||||
for offset, item in enumerate(tasks[len(rows):]):
|
||||
text = prompt(item['question'])
|
||||
base = tok.encode(text, add_special_tokens=False).ids
|
||||
if args.prefix == 'student':
|
||||
rollout = evaluate(model, tok, [item], {'student': SITES}, adapters)[0]['arms']['student']
|
||||
sampled = rollout['tokens']
|
||||
else:
|
||||
complete = tok.encode(text+str(item['answer'])+STOP_TEXT[0], add_special_tokens=False).ids
|
||||
assert complete[:len(base)] == base
|
||||
sampled = complete[len(base):]
|
||||
ids = torch.tensor([base+sampled])
|
||||
lengths = torch.tensor([ids.shape[1]])
|
||||
if captures:
|
||||
try:
|
||||
cached = replay_teacher_inputs(tail, captures[item['id']], ids, len(base), lengths)
|
||||
except (OSError, ValueError, KeyError) as exc:
|
||||
print('Using full native forward for reference prefixes:', exc, flush=True)
|
||||
captures = {}
|
||||
if not captures or offset == 0:
|
||||
inputs = full_teacher_inputs(model, teacher, ids, lengths)
|
||||
if captures:
|
||||
if all(torch.equal(a, b) for a, b in zip(inputs, cached)):
|
||||
print('Reference cache matches full native target, residual and donor', flush=True)
|
||||
else:
|
||||
print('Reference cache differs. Using full native forward', flush=True)
|
||||
captures = {}
|
||||
else:
|
||||
inputs = cached
|
||||
target, residual, donor = inputs
|
||||
opt.zero_grad(set_to_none=True)
|
||||
student, _ = tail(residual, donor, lengths, 'lisa', SITES)
|
||||
span = slice(len(base)-1, -1)
|
||||
loss = reverse_kl(student[0, span], target[0, span], chunks)
|
||||
loss.backward()
|
||||
if not torch.isfinite(loss) or any(p.grad is None or not torch.isfinite(p.grad).all() for p in tail.parameters()):
|
||||
raise FloatingPointError('Invalid reverse KL update')
|
||||
opt.step()
|
||||
rows.append({'id': item['id'], 'tokens': sampled, 'reverse_kl':float(loss.detach())})
|
||||
checkpoint(statefile, {'rows':rows,'weights':tail.adapters.state_dict(),'optimizer':opt.state_dict()})
|
||||
print(args.prefix, len(rows), '/', len(tasks), flush=True)
|
||||
checkpoint(directory/'adapter.pt', tail.adapters.state_dict())
|
||||
write_json(directory/'trace.json', rows)
|
||||
validate_checkpoint(model, tok, adapters, validation, prior['protocol'],
|
||||
directory/('validation-'+args.prefix+'.json'))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,56 @@
|
||||
# 三层跨层注意力共享的两种改进实验
|
||||
|
||||
复用 Qwen3.5-2B 中层号为 15、19、23 的三个全注意力接收层(按整个模型从零编号),在新的查表任务上评估完整整数答案。上一轮第二个训练轮次的 LiSA 检查点作为轨迹蒸馏的起点,适配器 SHA-256 为 `c82db5af7fa42cf58a349f3e53961da2360b211a7ed606f53a728860c64f6f29`。
|
||||
|
||||
论文库中的三个条目是 LiSA(2197656)、AdaRank(2204577)和 MiniLLM(2176556)。LiSA 提供跨层共享与低秩修正。AdaRank 用模型分歧估计各模块所需的相对秩,本实验改用逐层恢复对完整答案的影响估计秩。MiniLLM 用学生轨迹和逆 KL 做蒸馏,本实验使用贪心轨迹。 [LiSA 原文](https://aclanthology.org/2026.tacl-1.30/) · [AdaRank 原文](https://arxiv.org/abs/2408.09015) · [MiniLLM 原文](https://arxiv.org/abs/2306.08543)
|
||||
|
||||
## 题集与验证
|
||||
|
||||
8 对诊断题用于为三个层分配秩,8 对验证题用于在两个分秩训练轮次之间选检查点,32 对新留出题用于最后的配对比较。每对保持键、查询和表格顺序一致,交换目标键和一个干扰键的值。训练使用上一轮的 24 道拟合题。生成上限为 24 个 token,判分要求正常结束并能提取完整整数。主指标是完整答案准确率,次指标是同一对的两个答案都正确的比例。准确率差的 bootstrap 以题对为重采样单位。
|
||||
|
||||
## 层敏感度与秩分配
|
||||
|
||||
依次用原生 Q/K 恢复单个接收层,其余层使用上一轮训练的 LiSA。在诊断集上恢复正确答案净增最多的层取秩 48,其次取 40,最后取 32。同分时层号小者优先。恢复分数并列时会弱化对敏感度排序的解释。对照包括均匀秩和反向分配,以及关闭跨层分数输入后的均匀秩和敏感度分配。关闭共享输入时在融合网络前将供给层的分数通道置零。每组名义参数量一致,置零通道对应的权重不会获得有效训练信号。
|
||||
|
||||
另在相同的 16 道诊断题上,分别为原模型、已有 LiSA 和三个逐层恢复条件计算标准答案各 token 的全词表对数概率,包含结束符。按题保存结果,用于观察恢复一层后,模型是否给正确答案分配了更大的概率。分秩仍按预先冻结的完整答案正确数与同分规则执行。
|
||||
|
||||
分秩实验沿用上一轮教师分数与训练题的缓存。五组从固定种子初始化,各做两轮、每轮 24 步。按验证正确数选择检查点,同分取较早轮次。四组交互项为共享时分秩相对均匀秩的增益,减去关闭共享输入时的同一增益。反向分配用于检验高秩是否确实给对了层。
|
||||
|
||||
在远程训练环境中,用同一配置、训练代码和种子重新初始化五组适配器,按层核对参数摘要。相同秩配置的共享开启组与关闭组逐层完全相同。第 15 层在五组中均为秩 40,五组起始权重一致。第 19 和 23 层各有三种起始状态,对应三种秩分配。因此,分秩对照测量整套秩配置及其训练效果。 [初始参数核验](../results/lisa-combinations/rank-initialization.json)
|
||||
|
||||
留出答卷还会列出每项两组比较中从错变对、从对变错的题号。对跨层共享与分秩的组合,单列两个单项均答错而组合答对的题,以及两单项均答对而组合答错的题,同时附上关闭共享且使用均匀秩时的结果。这些题号解释净正确数的来源,四组交互项衡量两种改动的增益是否相互影响。另将敏感度分秩、学生前缀蒸馏和标准答案前缀蒸馏分别与上一轮实际使用的 LiSA 检查点逐题比较,报告净正确率差、按题对重采样的区间以及得失题号。均匀秩组使用本轮验证集选择检查点,因此与上一轮的 LiSA 分别列出。
|
||||
|
||||
## 学生轨迹蒸馏
|
||||
|
||||
在同一批 8 对验证题上,分别生成起始检查点、学生前缀组和标准答案前缀组三种完整答卷,并用冻结的分词器从 token 重算判分。三个检查点预先指定。验证答卷可用于在留出评估之前判断轨迹训练是否值得进一步研究。
|
||||
|
||||
两组均从上一轮 LiSA 权重开始,依次在相同 24 道训练题上各更新一次。学生轨迹组每步先用更新前的学生生成完整的贪心回答,在这些前缀上最小化学生对原模型的全词表逆 KL。参考轨迹组使用标准答案前缀,学习率、优化器和题序相同。两组均使用最后一步权重。生成路径固定时反向传播下一 token 分布的梯度。这是借鉴 MiniLLM 的简化方法。两组的训练步数相等,生成与训练 token 数和实际训练开销可不同。
|
||||
|
||||
学生前缀随更新变化,当前学生组以提交 `2338679` 的蒸馏代码逐题运行原生教师。标准答案前缀固定,参考组可以复用上一轮保存的第 15 层输入及第 11 层供给分数。先核验缓存回执、24 个文件的摘要、题序,再逐题核对完整 token 序列与答案起点。每次启动或续跑时,首道待训题同时走完整前向和缓存路径,逐元素核对教师最终隐状态、接收层输入和供给分数。三者完全相等后,后续题才使用缓存。缓存缺失或核对不符时,以完整教师前向继续。分秩组使用同一份缓存回执。参考组实际采用的路径由训练日志记录,解释训练耗时需考虑这项缓存复用。
|
||||
|
||||
## 复跑顺序
|
||||
|
||||
使用上一轮远程 CPU Python 环境和完整仓库依赖。所有命令共用 `--source`(冻结模型目录)、`--prior`(上一轮包含 frozen.json 和 final 子目录的作业目录)、`--out`(本轮独立目录)。按顺序运行以下 Python 模块。
|
||||
|
||||
1. `crossqkv.lisa_combination_screen` 冻结清单并生成四种诊断条件。
|
||||
2. `crossqkv.lisa_trajectory_train --prefix student` 和 `crossqkv.lisa_trajectory_train --prefix reference` 训练两个轨迹条件。
|
||||
3. `crossqkv.lisa_rank_compare` 根据诊断分数分配秩,训练五个条件。
|
||||
4. `crossqkv.lisa_combination_eval` 生成十组留出答卷,逐题校验并写入 holdout/audit.json。
|
||||
|
||||
冻结清单 SHA-256 为 `6858dbc64db0b989e8112e9dbea70662a2a05f66f11b180e8f2c668c74c43aef`。秩分配与轨迹方法分别和各自匹配的对照比较。跨路线的总训练预算不同。
|
||||
|
||||
留出评估按每批两题记录生成耗时,从提示词编码前计时到回答解析结束,同时汇总生成 token 数。远程 CPU 在多个作业间共享,这些运行记录用于解释实际开销。要验证部署加速,还需要在受控负载下重复测量。
|
||||
|
||||
标准答案前缀组运行期间,逐字节读取远程底座权重,核对 4,548,221,488 字节权重分片的 SHA-256 与冻结清单及上游摘要相同,并复核分词器和配置。[底座文件核验](../results/lisa-combinations/native-files.json)
|
||||
|
||||
已记录远程部署的 13 个实现与测试文件摘要。部署目录中的 `crossqkv/lisa_full_answer.py` 来自提交 `c53d78b`。它与本轮主线版本的差异限于该模块自身的筛选命令行入口,本轮调用的 `evaluate`、`prompt`、`grade` 等函数一致。 [远程代码摘要](../results/lisa-combinations/execution.sha256)
|
||||
|
||||
## 蒸馏权重更新幅度的补充实验
|
||||
|
||||
两个蒸馏终点在验证集分别答对 2/16 和 3/16,低于起始 LiSA 的 5/16。在主实验留出集开始生成前,为这两个终点各固定一个权重中点。对每个适配器张量,取起点和终点的算术平均,以 float64 计算后还原原精度。两个条件共享原底座,推理参数量与原 LiSA 相同,不增加训练步数。这个处理缩短了已训练的总权重位移,其效果可能与从头减半学习率不同。
|
||||
|
||||
在原定十组评估结束后,用相同的 16 道验证题、解码设置和完整答案判分比较起点、两个原终点、两个中点。单一插值系数固定为 0.5。任一中点在完整答案正确数上严格超过起点时,再对两个中点评估同一批 32 对留出题,与已生成的起点、相应终点和另一种前缀中点作配对比较。两者均未超过起点时,这项补充实验止于验证集。公布每组正确数、交换前后均正确的题对数以及各对照的救回和丢失题号。留出集差值以题对为单位、用固定种子 72505 做 10,000 次重采样。该补充分析因观察到验证退步而提出,结果单独记入 `trajectory-midpoint` 目录。
|
||||
|
||||
`python -m crossqkv.lisa_trajectory_midpoint` 接受与主实验一致的 `--source`、`--prior`、`--out`。附加 `--prepare-only` 时仅校验三个端点、生成两个中点及其摘要。正常运行会复核模型、已有答卷和已生成的中点,从每组已验证的完整答卷后续跑。
|
||||
|
||||
已在实验服务器用两个真实训练终点生成中点,并用独立实现逐元素复算。每个中点的 12 个张量、2,476,032 个参数均与按原精度取整的算术中点完全一致。[端点摘要及权重核验](../results/lisa-combinations/trajectory-midpoint/preparation.json)
|
||||
@@ -0,0 +1,104 @@
|
||||
# Qwen3.5-2B 三层 LiSA 共享实验结果
|
||||
|
||||
## 64 道留出题的完整答案
|
||||
|
||||
原生模型答对全部 64 题。三个接收层直接共享时,64 题全部生成了错误整数。原 LiSA 救回 13 题,学生前缀蒸馏救回 14 题。以原 LiSA 为对照,学生组新答对 6 题、丢失 5 题,净增 1.56 个百分点。按 32 个题对重采样的 95% 区间为 −7.81 至 +10.94 个百分点。学生组有 2 对在交换目标值前后均正确,值得用更多独立题对和训练种子复核。 [十组答卷与核验回执](../results/lisa-combinations/holdout/)
|
||||
|
||||
| 方法 | 完整答案正确 /64 | 交换前后均正确 /32 |
|
||||
|---|---:|---:|
|
||||
| 原生模型 | 64 | 32 |
|
||||
| 直接共享 | 0 | 0 |
|
||||
| 原 LiSA | 13 | 0 |
|
||||
| 均匀秩重训 | 13 | 0 |
|
||||
| 共享 + 敏感度分秩 | 10 | 0 |
|
||||
| 共享 + 反向分秩 | 12 | 1 |
|
||||
| 关闭共享输入,均匀秩 | 3 | 0 |
|
||||
| 关闭共享输入,敏感度分秩 | 5 | 0 |
|
||||
| LiSA + 学生前缀蒸馏 | 14 | 2 |
|
||||
| LiSA + 标准答案前缀蒸馏 | 10 | 0 |
|
||||
|
||||
敏感度分秩在关闭共享时多答对 2 题,在开启共享时少答对 3 题。两种改动的交互差为 −7.81 个百分点,95% 区间为 −17.19 至 +1.56。组合在 test-024-1 和 test-030-0 上答对了两个单项都答错的题,但整体 10/64 低于单用共享的 13/64。学生蒸馏与标准答案蒸馏相差 +6.25 个百分点,区间为 0 至 +14.06。本实验只比较 LiSA 上的两种前缀,无法估计蒸馏与共享的四组交互。结论限于本模型和成对查表任务。 [逐题得失与区间](../results/lisa-combinations/holdout/audit.json)
|
||||
|
||||
五个分秩条件均完成 48 次更新。反向组两轮验证均为 4/16,关闭共享的均匀组为 2/16、0/16,关闭共享的敏感度组为 2/16、2/16,三组均按预定规则选中第一轮。 [五组验证汇总](../results/lisa-combinations/rank-validation.json) · [蒸馏中点验证](../results/lisa-combinations/trajectory-midpoint/validation/summary.json)
|
||||
|
||||
## 逐层恢复与分秩
|
||||
|
||||
在 Qwen3.5-2B 的 8 对查表题上,单独恢复第 19 层的原生 Q/K,16 道完整答案全部正确。恢复第 15 层答对 15 道,恢复第 23 层答对 1 道。其余两个接收层继续使用同一份 LiSA 权重,每次恢复都会影响下游计算。层号按整个模型从零开始。 [冻结协议](LISA_COMBINATIONS_PROTOCOL.md)
|
||||
|
||||
| 条件 | 完整答案正确 | 同一对交换前后均正确 |
|
||||
|---|---:|---:|
|
||||
| 原 LiSA | 0/16 | 0/8 |
|
||||
| 恢复第 15 层 | 15/16 | 7/8 |
|
||||
| 恢复第 19 层 | 16/16 | 8/8 |
|
||||
| 恢复第 23 层 | 1/16 | 0/8 |
|
||||
|
||||
四组共 64 次生成均得到完整整数。逐题复核使用冻结分词器重新解码 token,检查正常结束或长度上限、题目 ID、标准答案及记分。复核回执保存了原始答卷、题集、分词器及起始适配器的 SHA-256。 [逐题答卷及复核回执](../results/lisa-combinations/diagnostic/)
|
||||
|
||||
这组题可以区分模型是否跟随目标值变化,以及变化后是否答对。原 LiSA 在 8 对题上全都重复了交换前的数字,尽管每对的正确答案都变了。16 个错误答案中,12 个是该题表内其他键的值,4 个是表外数字。恢复第 15 层后,8 对的回答都随交换变化,7 对两次都正确。恢复第 19 层后,8 对两次都正确。恢复第 23 层后,4 对的回答发生变化,但没有一对两次都正确。这些计数来自同一诊断集,用于解释按层分秩的依据。 [成对题目](../results/lisa-combinations/protocol.json) · [四组原始回答](../results/lisa-combinations/diagnostic/)
|
||||
|
||||
第 15 层和第 19 层的正确性只在一题上有差异。目标键位于第 9 项,值为 39,恢复第 15 层生成第 8 项的 98,恢复第 19 层生成 39。交换表项后,两种恢复条件都正确生成 77。每次去掉一对题重新排序,第 23 层在 8 次中均居末位。去掉上述题对时,第 15 层和第 19 层打平,预定的同分规则将第 15 层排在前面。其他 7 次均为第 19 层领先。从这 8 对题中有放回地抽取 8 对,漏掉唯一分出高下的题对的比例为 (7/8)⁸,即 34.4%,此时第 15 层按同分规则排第一。其余 65.6% 的抽样中第 19 层排第一,第 23 层在所有抽样中均排最后。这个比例描述当前诊断题的重采样结果。 [配对复核](../results/lisa-combinations/diagnostic/verified.json)
|
||||
|
||||
按全部诊断题,敏感度分配给第 15、19、23 层的秩依次为 **40、48、32**。均匀对照为 40、40、40,反向对照为 40、32、48。上述结果衡量恢复原生 Q/K 的效果。增加低秩参数能救回多少答案,以及学生轨迹蒸馏能否改善生成,已在训练后用 32 对新留出题检验。
|
||||
|
||||
五个分秩条件各有 2,476,032 个适配器参数。关闭共享时,三个接收层各有 8 个供给分数通道被置零,每个通道连接到 256 个融合单元。因此共有 6,144 个权重(占 0.248%)的输入恒为零,其余 2,469,888 个权重保留连接。分别在开启和关闭共享的条件内比较分秩与均匀秩,两侧的连接数各自相等。
|
||||
|
||||
### 正确答案的概率
|
||||
|
||||
原 LiSA 对正确首位数字的平均概率为 **10.2%**。恢复第 15 或第 19 层后,这一概率分别达到 **76.8%** 和 **78.3%**。在已给定正确首位数字时,两种恢复条件对正确次位数字的平均概率都超过 99%。恢复第 23 层也在全部 16 题上提高了整段正确答案的概率,但首位数字的平均概率仅升至 **12.5%**,最终只答对 1 题。
|
||||
|
||||
| 条件 | 正确首位数字平均概率 | 给定正确首位后的次位数字平均概率 | 整段正确答案平均负对数概率(nats) |
|
||||
|---|---:|---:|---:|
|
||||
| 原生模型 | 96.8% | 99.9% | 0.035 |
|
||||
| 原 LiSA | 10.2% | 59.8% | 3.917 |
|
||||
| 恢复第 15 层 | 76.8% | 99.6% | 0.305 |
|
||||
| 恢复第 19 层 | 78.3% | 99.6% | 0.274 |
|
||||
| 恢复第 23 层 | 12.5% | 60.0% | 3.328 |
|
||||
|
||||
每个条件在同样的 16 题上按全词表评分。每题的整段分数为两个正确数字及结束符的负对数概率之和,再对题目取平均。在贪心解码得分仅相差一题的第 15、19 层之间,恢复第 19 层在 9 题上给整段标准答案更高概率,第 15 层在另外 7 题更高。两者唯一答对情况不同的题以数字 3 开头,恢复第 15 层和第 19 层给这个首位数字的概率分别是 39.9% 和 62.5%。这组数据支持优先关注第 15、19 层,对二者的内部排序证据较弱。原分配继续按预定规则训练。 [逐题逐 token 概率](../results/lisa-combinations/diagnostic/diagnostic-gold-log-probs.json) · [分词器、概率统计与贪心回答核验](../results/lisa-combinations/diagnostic/gold-probability-check.json)
|
||||
|
||||
## 固定参数预算下的分秩验证
|
||||
|
||||
五个分秩条件分别训练 48 步,使用同样的 24 个训练样本、题序及 2,476,032 个参数。第 15、19、23 层均取秩 40 的对照组复现了原 LiSA,48 步训练损失记录、选中检查点的各参数张量和权重文件 SHA-256 全部一致。两者在验证集的 16 个完整回答也逐 token 相同。 [均匀秩配置](../results/lisa-combinations/shared-uniform/config.json) · [两轮原始答卷](../results/lisa-combinations/shared-uniform/trace.json) · [参数与训练核验](../results/lisa-combinations/shared-uniform/verified.json)
|
||||
|
||||
| 第 15、19、23 层的秩 | 第 1 轮答对 | 第 2 轮答对 | 选中轮次 | 交换前后均正确 |
|
||||
|---|---:|---:|---:|---:|
|
||||
| 均匀分配 40、40、40 | 3/16 | 5/16 | 2 | 1/8 |
|
||||
| 按敏感度分配 40、48、32 | 2/16 | 3/16 | 2 | 0/8 |
|
||||
|
||||
在第一轮,敏感度分秩比均匀秩少答对 1 道。第二轮两组有 12/16 题逐 token 相同,分秩丢失 2 道,救回 0 道。两道退步都来自第 003 对题。均匀组随目标值交换从 93 改答 83,分秩组两次都回答表格第 1 项的 33。总体上,换值后分秩组有 3/8 对改变回答,均匀组有 2/8 对改变回答。只有均匀组在其中一对上两次都给出了目标值。 [分秩配置](../results/lisa-combinations/shared-allocated/config.json) · [分秩两轮答卷](../results/lisa-combinations/shared-allocated/trace.json) · [分秩核验](../results/lisa-combinations/shared-allocated/verified.json) · [两组逐题比较](../results/lisa-combinations/rank-validation.json)
|
||||
|
||||
如果逐题任选敏感度分秩或学生前缀蒸馏的回答,16 题里最多能答对 3 道。再允许选原 LiSA 的回答,上限是 5 道。两条路线在这批验证题上都没有贡献原 LiSA 答错的新题。预定的 32 对新留出题用于检验这一结果能否推广。
|
||||
|
||||
### 同一笔秩预算在注意力分数上能换来多少改善
|
||||
|
||||
取 24 道训练题的原生注意力分数,把题号按奇偶分半。在一半题上用第 11 层的 8 个头线性拟合三个接收层的分数(含截距),在另一半逐题计算剩余误差,两半互换。对每一题、每一层、每一个头,直接用奇异值分解求剩余分数矩阵的最佳秩近似。下表是所有 token 对的均方误差,各题等权。这项分析可用旧缓存复跑,不需要加载底座。 [计算脚本](../crossqkv/lisa_rank_residuals.py) · [逐题误差与七种分配](../results/lisa-combinations/fit-rank-residuals.json)
|
||||
|
||||
| 接收层 | 秩 32 | 秩 40 | 秩 48 | 从 40 增至 48 减少的误差 |
|
||||
|---|---:|---:|---:|---:|
|
||||
| 15 | 0.03952 | 0.02078 | 0.01084 | 0.00994 |
|
||||
| 19 | 0.04404 | 0.02256 | 0.01152 | 0.01104 |
|
||||
| 23 | 0.04279 | 0.02261 | 0.01179 | 0.01082 |
|
||||
|
||||
第 19 层从 40 增到 48,平均误差下降 0.01104。为它让出这 8 个秩,第 23 层从 40 降到 32,误差上升 0.02018。三层平均误差由均匀秩的 0.02198 升到敏感度分秩的 0.02503,增加 13.9%。对每一道训练题,把 32、40、48 任意分给三层的六种排列,其误差都高于三层各取 40。另用 QR 分解拟合供给头映射,显式重建各秩的矩阵,288 个逐题、逐层误差(含秩 0)与奇异值计算的最大绝对差小于 2×10⁻¹⁴。
|
||||
|
||||
这项近似用同一个第 11 层预测三个接收层,并可逐题看到原生目标矩阵。实际 LiSA 依次把第 11、15、19 层的分数传给第 15、19、23 层,后两次传递的是上一接收层的融合输出。模型还须从隐藏状态预测局部分数。13.9% 衡量的是固定第 11 层时的矩阵近似误差,实际链式共享的效果由完整答案检验。 [训练前向](../crossqkv/lisa_tail.py) · [贪心生成前向](../crossqkv/lisa_generate.py)
|
||||
|
||||
把供给改成上一全注意力层的**原生分数**后,均匀秩的三层平均误差为 0.01682,敏感度分秩为 0.01901(增加 13.0%),反向分秩为 0.01885(增加 12.1%)。六种非均匀排列在每道题上的误差仍然都更高,但两种分秩的相对顺序随供给层而改变。固定第 11 层时,敏感度分秩在 23/24 题上优于反向分秩。使用相邻层原生分数时,这一数字降至 2/24。两种分析都支持均匀秩在这七个配置里的分数近似优势,要判断多给第 19 层还是第 23 层更有利于完整答案,仍须比较训练后的链式模型。脚本选项为 `--adjacent-native`。独立 QR 拟合及逐头矩阵重建复核了 288 个误差值,最大绝对差小于 2×10⁻¹⁴。 [相邻原生供给的逐题数据](../results/lisa-combinations/fit-rank-adjacent-native.json)
|
||||
|
||||
## 两种蒸馏前缀的完整答案
|
||||
|
||||
两种蒸馏在同一批 16 道验证题上都丢掉了原 LiSA 答对的题,也都没有救回原本答错的题。学生前缀组比标准答案前缀组少答对 1 道。三组共 48 个回答均正常结束,可解析出完整整数。 [起始 LiSA 答卷](../results/lisa-combinations/validation-prior-lisa.json) · [学生前缀答卷](../results/lisa-combinations/trajectory-student/validation-student.json) · [标准答案前缀答卷](../results/lisa-combinations/trajectory-reference/validation-reference.json)
|
||||
|
||||
| 条件 | 完整答案正确 | 交换前后均正确 | 相对起始 LiSA 救回/丢失 |
|
||||
|---|---:|---:|---:|
|
||||
| 起始 LiSA | 5/16 | 1/8 | — |
|
||||
| 标准答案前缀蒸馏 | 3/16 | 0/8 | 0/2 |
|
||||
| 学生前缀蒸馏 | 2/16 | 0/8 | 0/3 |
|
||||
|
||||
第 003 对题的目标键在第 11 项,交换后其值从 93 变为 83。起始 LiSA 两次都答对,两种蒸馏都连续两次读出第 5 项的 43。这个退步在只使用标准答案前缀训练时也出现了。第 006 对的第一题是两种蒸馏在正确性上唯一有差别的题,标准答案前缀组答对 78,学生前缀组生成了表中没有的 38。两种蒸馏在全部 16 题中有 13 题生成完全相同的 token。 [逐题得失与题对比较](../results/lisa-combinations/trajectory-validation.json)
|
||||
|
||||
两组从同一份 LiSA 权重出发,在相同的 24 道训练题上按相同顺序各完成 24 次逆 KL 更新,各有 72 个下一 token 预测位置。11 道题的两条训练轨迹完全相同,全部 72 个位置中有 25 个位置的前缀不同。标准答案前缀组启动时,缓存路径的教师最终隐状态、接收层输入与供给分数同完整原生前向逐元素相等。 [学生训练轨迹](../results/lisa-combinations/trajectory-student/trace.json) · [标准答案训练轨迹](../results/lisa-combinations/trajectory-reference/trace.json)
|
||||
|
||||
两组验证答卷已用冻结的分词器重新判分,并核对优化器更新次数、最后一个训练检查点和实际评估的权重。本次验证支持这套蒸馏配置在这 8 对题上没有改善最终答案。32 对新留出题用于检验这个结果能否推广。 [学生组核验](../results/lisa-combinations/trajectory-student/verified.json) · [标准答案组核验](../results/lisa-combinations/trajectory-reference/verified.json) · [实验协议](LISA_COMBINATIONS_PROTOCOL.md)
|
||||
|
||||
论文库第 1526876 条 WiSE-FT 在零样本模型与其微调终点之间做权重插值,并在图像分类的分布偏移上检验鲁棒性。本实验将同一操作用于 LiSA 适配器,固定保留学生前缀或标准答案前缀蒸馏位移的一半。两个真实中点已经逐参数核验,两种中点在验证集都答对 4/16,均未超过起点的 5/16,依预定规则止于验证集。 [WiSE-FT 原文](https://openaccess.thecvf.com/content/CVPR2022/html/Wortsman_Robust_Fine-Tuning_of_Zero-Shot_Models_CVPR_2022_paper.html) · [权重核验](../results/lisa-combinations/trajectory-midpoint/preparation.json) · [补充协议](LISA_COMBINATIONS_PROTOCOL.md)
|
||||
@@ -0,0 +1,165 @@
|
||||
# LiSA effect reproduction on Qwen3.5-2B
|
||||
|
||||
The earlier single-layer training verified the method but used an evaluation
|
||||
where the frozen 2B model answered only one of sixteen items. This protocol
|
||||
measures retention of an existing capability and the cost of exercising it.
|
||||
|
||||
## Comparison with the published experiment
|
||||
|
||||
The 96.44% in Table 2 is the average performance retained by LLaMA2-13B
|
||||
with 22 recipient layers across the reported benchmarks excluding LAMBADA.
|
||||
At the same 22 layers, direct score sharing retained 46.76% and the direct
|
||||
sharing plus LoRA baseline retained 65.95%. The published main uptraining
|
||||
used 4.2 billion sampled RedPajama tokens on eight A800 GPUs. This experiment
|
||||
uses a frozen Qwen3.5-2B backbone, two recipient layers, 12 synthetic fit
|
||||
prompts and a single CPU runner. Each epoch of the trainable variants sees
|
||||
1,874 next-token targets drawn from those same 12 prompts. The comparable
|
||||
effect is an improvement over direct sharing under a fixed layer schedule.
|
||||
The magnitude on a 32-item lookup test and the timing of CPU attention should
|
||||
be interpreted within those settings. [Mu et al., Table 2 and Appendix C.1](https://aclanthology.org/2026.tacl-1.30.pdf)
|
||||
|
||||
Qwen's text decoder has six full-attention layers and 18 linear-attention
|
||||
layers. The chained configuration modifies two of the six full-attention
|
||||
layers and two of the 24 decoder layers overall. Layer numbers are zero-based.
|
||||
The source record in `results/lisa-effect-reproduction/runtime.json` pins
|
||||
the original model revision, the checkpoint shard and its download-manifest hash.
|
||||
|
||||
## Task and layer screening
|
||||
|
||||
All four tasks, answer-position balances, and generators are fixed in
|
||||
`crossqkv/lisa_effect_screen.py`. The screening split is used only for
|
||||
selecting a primary task family and the schedule. Fit, validation, and test
|
||||
prompts have disjoint fixed seeds. The screen must finish before opening
|
||||
test metrics.
|
||||
|
||||
Test original attention, 19→23 direct reuse, and a chained 15→19→23
|
||||
configuration, with each donor providing its actual scores in the current
|
||||
run. Primary eligibility on the development screen requires original accuracy
|
||||
at least 5/8 and at least one original-correct item lost under shared
|
||||
attention. Compare candidate schedules by the count of native-correct items
|
||||
lost, preferring the two-receiver schedule among ties and recording net
|
||||
accuracy and four-option NLL. If none qualify, retain the screen and expand
|
||||
development coverage before choosing a new task; never pick based on test
|
||||
errors. The fixed test also reports all outcomes on the chosen task, including
|
||||
native-incorrect items.
|
||||
|
||||
## Performance comparison
|
||||
|
||||
Compare native, direct, fit-only linear calibration and trainable LiSA on
|
||||
identical prompts. Preserve Qwen recipient gates, V, and output projection.
|
||||
Compare the published 0.25 Huber and 0.75 next-token CE objective with an
|
||||
explicit answer-weighted variant. All adaptation and model selection use
|
||||
only fit/validation. Record the whole-sequence training loss. On held-out prompts, report
|
||||
answer-only loss, correctly recovered and newly lost questions, net
|
||||
accuracy, and performance at one and two recipients. A measured failure to recover is a valid outcome.
|
||||
|
||||
For speed, use a path that actually skips dense Q/K at shared sites, keeping
|
||||
gate rows. Verify against a reference first. With identical prompts,
|
||||
checkpoint and runner, report measured latency for the implemented prefill
|
||||
or decode path and its true scope. Account for both the reduced K storage
|
||||
and additional score tensors. Do not call analytical estimates measured
|
||||
speed or apply paper throughput figures to this CPU implementation.
|
||||
|
||||
The incremental recipient benchmark uses actual K/V buffers and compares the
|
||||
shared implementation with native attention at the same prefix length and FP32
|
||||
storage format. Numerical tests compare incremental scores and outputs with
|
||||
batched causal attention at every query position. Report observed allocation
|
||||
for K/V and the donor score row separately from end-to-end prefill or decode.
|
||||
It does not include upstream score generation or the rest of the decoder.
|
||||
|
||||
```sh
|
||||
python -B -m crossqkv.lisa_decode_bench --source runs/cpu-qwen35-2b \
|
||||
--capture runs/LISA_EFFECT_CAPTURE --checkpoint runs/LISA_EFFECT_RESULTS/lisa.pt \
|
||||
--out runs/LISA_EFFECT_RESULTS/decode.json
|
||||
```
|
||||
|
||||
An interrupted development screen can resume with the same fixed prompt set
|
||||
using `--resume`. Use `--reuse-prefix` to compute the frozen prefix once per
|
||||
prompt. The replay checks original-mode parity before accepting results.
|
||||
|
||||
## Recorded development selection
|
||||
|
||||
The fixed screen completed with 32 prompts. The prespecified eligibility rule
|
||||
selected the 16-entry lookup task with recipients at layers 19 and 23. Native
|
||||
and one-recipient direct sharing each scored 8/8. Two-recipient direct sharing
|
||||
scored 7/8 and lost one native-correct answer. The selected configuration,
|
||||
all screened logits, and the disjoint prompt manifest are archived under
|
||||
`results/lisa-effect-reproduction/`. This was selection evidence only.
|
||||
|
||||
The held-out analysis records rescue of native-correct errors, newly introduced
|
||||
errors, paired uncertainty and answer NLL. A second pass streams the complete
|
||||
vocabulary at the same answer positions and compares one- and two-recipient
|
||||
forward paths. In the one-recipient LiSA ablation the final adapter comes from
|
||||
the joint checkpoint. It is evaluated unchanged, with the earlier recipient
|
||||
restored to native attention.
|
||||
|
||||
Training also saves each finished epoch's adapter, AdamW state, validation
|
||||
history and selected weights atomically per variant. For interrupted training,
|
||||
re-run the same command with `--resume` and the same output directory and epoch
|
||||
budget. Resume verifies the frozen training configuration, preserves finished
|
||||
epochs and re-scores the locked test set from the validation-selected weights.
|
||||
The separate selected checkpoints retain the original weights-only schema.
|
||||
|
||||
The development error was `screen-lookup16-005`. Its correct choice was
|
||||
option 4. Across native, single-recipient direct reuse and chained direct reuse,
|
||||
the four-choice probability of option 4 was 0.706, 0.815 and 0.403,
|
||||
respectively. Its correct-versus-best-distractor logit margins were
|
||||
+1.265, +1.861 and −0.258. The chained result chose option 2. These are
|
||||
development observations that describe the selected condition, not test
|
||||
results or a basis for changing the frozen prompts.
|
||||
|
||||
## Reproduction commands
|
||||
|
||||
Run from the project code root on the confirmed remote CPU environment.
|
||||
Choose new output directories. Keep the same source checkpoint across all
|
||||
commands. The fixed manifest contains all four split definitions, and capture
|
||||
writes an independent selection record and source fingerprints.
|
||||
|
||||
```sh
|
||||
export OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1
|
||||
PYTHON=venv/bin/python
|
||||
SOURCE=runs/cpu-qwen35-2b
|
||||
SCREEN=runs/NEW_EFFECT_SCREEN
|
||||
CAPTURE=runs/NEW_EFFECT_CAPTURE
|
||||
RESULT=runs/NEW_EFFECT_RESULT
|
||||
|
||||
"$PYTHON" -B -m crossqkv.lisa_effect_screen --source "$SOURCE" --out "$SCREEN" --reuse-prefix
|
||||
"$PYTHON" -B -m crossqkv.lisa_effect capture --source "$SOURCE" --input "$SCREEN" --out "$CAPTURE"
|
||||
"$PYTHON" -B -m crossqkv.lisa_effect train --source "$SOURCE" --input "$CAPTURE" --out "$RESULT" --epochs 2
|
||||
"$PYTHON" -B -m crossqkv.lisa_decode_bench --source "$SOURCE" --capture "$CAPTURE" \
|
||||
--checkpoint "$RESULT/lisa.pt" --out "$RESULT/decode.json"
|
||||
"$PYTHON" -B -m crossqkv.lisa_effect_answer_audit --source "$SOURCE" --cache "$CAPTURE" \
|
||||
--trained "$RESULT" --out "$RESULT/full-vocab-answers.json"
|
||||
"$PYTHON" -B -m crossqkv.lisa_effect_audit --fixed "$SCREEN/fixed-problems.json" \
|
||||
--selection "$CAPTURE/selection.json" --items "$RESULT/test-items.json" \
|
||||
--perf "$RESULT/performance.json" --decode "$RESULT/decode.json" \
|
||||
--full-vocab "$RESULT/full-vocab-answers.json" --out "$RESULT/paired-audit.json"
|
||||
```
|
||||
|
||||
The paired audit defines a rescue as a native-correct item made wrong by
|
||||
direct sharing and made correct again by the tested adapter. It reports
|
||||
newly lost native-and-direct-correct items separately. An improvement in
|
||||
mean four-option answer NLL, including among items already answered
|
||||
correctly, does not by itself establish a rescue. The audit computes paired
|
||||
intervals for NLL differences and checks that common arms have identical
|
||||
four-choice correctness in the primary test and the full-vocabulary pass.
|
||||
|
||||
Training scores *all* valid shifted tokens with exact full-vocabulary CE
|
||||
and uses the validation four-option answer loss to freeze checkpoints. The
|
||||
answer audit scores only the answer position over the whole vocabulary.
|
||||
The answer is one token per prompt. In the fit set, it accounts for about
|
||||
0.64% of the unweighted CE target mass and about 9.35% with the 16-fold answer
|
||||
weight. The objective applies the same 0.75 coefficient to the resulting
|
||||
mean CE in both trainable variants.
|
||||
It does not report whole-prompt CE for the held-out items or free-form
|
||||
multi-token answer accuracy. That distinction is important for interpreting
|
||||
the previous experiment, in which those two losses moved in opposite
|
||||
directions.
|
||||
|
||||
For the isolated incremental attention timing, report both streamed
|
||||
checkpoint projections and an otherwise identical timing with only that
|
||||
site's frozen projections resident in memory. Verify output and raw score
|
||||
parity before interpreting the pair of timings. The resident measurements
|
||||
exclude weight-load time, and both timings exclude upstream computation and
|
||||
other decoder blocks. K/V and upstream score-row allocation are itemized
|
||||
separately; neither timing is an end-to-end server throughput claim.
|
||||
@@ -0,0 +1,49 @@
|
||||
# Qwen3.5-2B 双层 LiSA 复现实验
|
||||
|
||||
在冻结的 32 道查找题上,原模型、直接共享、线性修正和两版 LiSA 的四选一准确率均为 32/32。全词表首 token 命中率从双层直接共享的 27/32 升到两版 LiSA 的 32/32。五道变化题都涉及首 token 从 `<think>` 变成正确选项。两个接收层各自的 K/V 缓存减少 42.2%。耗时随权重是否驻留及测量阶段而异。
|
||||
|
||||
## 四选一任务表现
|
||||
|
||||
开发筛选中,原模型和单层直接共享各答对 8/8,双层直接共享答对 7/8。以此冻结 16 条目查找任务,测试使用独立题目。共享链为 15→19→23,层号从 0 起算。第 19、23 层占 6 个全注意力层的三分之一,占 24 个解码层的十二分之一。
|
||||
|
||||
| 方法 | 留出正确数 | 四选一答案 NLL ↓ |
|
||||
| --- | ---: | ---: |
|
||||
| 原模型 | 32/32 | 0.1341 |
|
||||
| 双层直接共享 | 32/32 | 0.0728 |
|
||||
| 双层线性修正 | 32/32 | 0.0720 |
|
||||
| 双层 LiSA | 32/32 | 0.1846 |
|
||||
| 双层 LiSA,答案损失加权 | 32/32 | 0.1260 |
|
||||
|
||||
直接共享在留出集上丢失 0 道原模型答对的题,因此无法估计 LiSA 对这类错题的恢复率。答案加权把 LiSA 的四选一 NLL 降低了 0.0586,仍高于直接共享。相比直接共享,原版 LiSA 的 NLL 增加 0.1118,按题配对 bootstrap 95% 区间为 [0.0968, 0.1282]。答案加权 LiSA 的差为 0.0532,区间为 [0.0327, 0.0749]。三种训练方法各用 12 道拟合题跑两轮,并由另外 12 道验证题选择检查点。所选检查点都是第 2 轮。
|
||||
|
||||
## 全词表首 token
|
||||
|
||||
| 方法 | 正确选项为首 token | 全词表答案 NLL ↓ |
|
||||
| --- | ---: | ---: |
|
||||
| 原模型 | 27/32 | 0.5633 |
|
||||
| 单层直接共享,第 23 层 | 32/32 | 0.3124 |
|
||||
| 单层 LiSA,第 23 层,使用双层训练的适配器 | 32/32 | 0.2554 |
|
||||
| 双层直接共享 | 27/32 | 0.5579 |
|
||||
| 双层线性修正 | 27/32 | 0.5574 |
|
||||
| 双层 LiSA | 32/32 | 0.4706 |
|
||||
| 双层 LiSA,答案损失加权 | 32/32 | 0.1545 |
|
||||
|
||||
两版 LiSA 对双层直接共享的首 token 净改善均为 5/32,另有 0 道从正确变成错误,McNemar 精确双侧 p = 0.0625。双层直接共享比单层直接共享少答对的五道,恰好也是原模型和线性修正先输出 `<think>` 的五道。它们的正确选项都是 `4`,四选一口径在全部方法上均答对。输出符合格式是这里观察到的改善,后续生成内容没有记录。
|
||||
|
||||
原版 LiSA 相对双层直接共享的全词表 NLL 差为 −0.0872,按题配对 bootstrap 95% 区间为 [−0.1498, −0.0305]。答案加权版的差为 −0.4033,区间为 [−0.4796, −0.3344]。原版和加权版的首 token 命中数一致,加权版的平均答案 NLL 更低。由于五道变化集中于同一选项和同一个替代 token,推广到其它任务或输出格式还需要独立证据。
|
||||
|
||||
## CPU 计时和缓存
|
||||
|
||||
| 测量范围 | 原模型 | LiSA |
|
||||
| --- | ---: | ---: |
|
||||
| 缓存前缀后的尾部预填充,157 tokens | 12.37 s | 16.31 s |
|
||||
| 第 19 层单步,流式读取权重 | 136.15 ms | 96.32 ms |
|
||||
| 第 23 层单步,流式读取权重 | 136.39 ms | 138.80 ms |
|
||||
| 第 19 层单步,投影权重常驻 | 42.57 ms | 32.09 ms |
|
||||
| 第 23 层单步,投影权重常驻 | 44.80 ms | 22.79 ms |
|
||||
|
||||
每个接收层的 FP32 K/V 实际分配从 643,072 降到 371,776 字节,下降 42.2%。计入该层所用的 5,024 字节上游分数行后,单层合计下降 41.4%。V 缓存为 321,536 字节。解码计时的单位是单个接收层的一步,计时范围从接收现成分数行开始,至该层注意力输出结束。预填充用 3 次计时的中位数,单层解码每个配置用 9 步计时的中位数。
|
||||
|
||||
论文表 2 的 96.44% 衡量 LLaMA2-13B 在共享 22 层时多个基准上的平均性能保留率。这里每轮只有 1,874 个训练目标 token,测到的是单一查找任务的表现和 CPU 组件耗时。 [论文表 2、表 3 和附录 C.1](https://aclanthology.org/2026.tacl-1.30.pdf)
|
||||
|
||||
训练轨迹、两种答案口径的逐题记录、配对统计、缓存和时延原始结果均在 [实验结果目录](../results/lisa-effect-reproduction/)。[复跑协议](LISA_EFFECT_PROTOCOL.md)
|
||||
@@ -0,0 +1,42 @@
|
||||
# 完整答案评估下的 LiSA 共享实验
|
||||
|
||||
本轮在同一 Qwen3.5-2B 检查点上比较 3、4、5 个全注意力层接收共享分数的效果。上一轮发现首 token 命中的变化集中在 `<think>` 和同一个选项。本轮要求模型从全词表生成完整的多 token 数值答案,逐题复核答案的数值。
|
||||
|
||||
## 开发筛选与冻结
|
||||
|
||||
从 0 开始编号。接收层分别为 `[15, 19, 23]`、`[11, 15, 19, 23]` 和 `[7, 11, 15, 19, 23]`。每个接收层使用本次前向中前一全注意力层实际输出的分数。接收端保留自身的 V、门控和输出投影。原模型与三个直接共享配置配对生成。
|
||||
|
||||
候选任务为表中数值查找、重复键最后值查找、两位数加法、重复项计数。固定生成器在运行筛选之前写出每类任务 8 道开发题、24 道训练题、8 道验证题和 32 道留出测试题。同一数值题跨数据划分去重,加法按交换律规范操作数。每个候选都要满足原模型至少答对 6/8 且至少 2 道原模型答对的题在直接共享下生成了错误整数。选择时依次比较数字错误数、原模型正确数和接收层数,仍并列时取字典序最大的任务标识。完成了生成却没有可提取答案的情况单独记数。
|
||||
|
||||
使用检查点发布的单轮聊天模板和关闭 thinking 的生成前缀。所有配置从全词表逐 token 贪心生成,遇到回合结束或文本结束 token 停止,最多生成 24 tokens。主要指标要求已生成停止 token,并从整条答复提取完整整数。接受纯整数或明确的最终答案行,可去掉开头完整的 thinking 区块。原始 token、文本、停止原因和提取值都随结果存档。 [检查点聊天模板](https://huggingface.co/Qwen/Qwen3.5-2B/blob/15852e8c16360a2fea060d615a32b45270f8a8fc/chat_template.jinja)
|
||||
|
||||
## LiSA 训练与测试
|
||||
|
||||
开发筛选完成后用固定哈希验证题集、共享配置、原模型和筛选数据。仅在存在达标配置时启动训练。冻结原模型,只训练两个线性层组成的注意力头融合和 rank 40 的低秩 Q/K。用原模型在同一训练序列上的遮罩前注意力分数作为教师。损失为 0.25 倍 Huber 距离加 0.75 倍全词表交叉熵。Huber 覆盖实际序列长度内的所有查询和键,注意力前向应用因果遮罩。交叉熵覆盖参考答案的所有 token 和结束 token。每个训练样本更新后保存优化器和模型状态。验证集上生成完整答案,按正确数选择两轮中的最佳检查点,同分选较早者。
|
||||
|
||||
最终对同一批留出题的原模型、直接共享、训练后的 LiSA 分别生成并保存完整回答。报告准确率、直接共享造成的数值错误、其中被 LiSA 恢复的题、新增错误和缺少可提取答案的情况。准确率差按题配对估计,另报告 McNemar 精确双侧检验。
|
||||
|
||||
## 运行命令
|
||||
|
||||
在已确认的远程 CPU 环境中,从源代码目录运行,使用独立输出目录。模型源目录需要包含上一轮实验使用的权重、配置、下载清单和 tokenizer。
|
||||
|
||||
```sh
|
||||
export OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1
|
||||
PYTHON=venv/bin/python
|
||||
SOURCE=runs/cpu-qwen35-2b
|
||||
SCREEN=runs/NEW_FULL_ANSWER_SCREEN
|
||||
RESULT=runs/NEW_FULL_ANSWER_RESULT
|
||||
|
||||
"$PYTHON" -B -m crossqkv.lisa_full_answer --source "$SOURCE" --out "$SCREEN" --batch-prompts 1 --preflight
|
||||
"$PYTHON" -B -m crossqkv.lisa_full_answer --source "$SOURCE" --out "$SCREEN" --batch-prompts 1
|
||||
"$PYTHON" -B -m crossqkv.lisa_full_answer_train --source "$SOURCE" --screen "$SCREEN" --out "$RESULT"
|
||||
"$PYTHON" -B -m crossqkv.lisa_full_answer_verify --tokenizer "$SOURCE/tokenizer.json" \
|
||||
--frozen "$SCREEN/frozen.json" --selection "$SCREEN/selection.json" \
|
||||
--rows "$RESULT/test-items.json" --out "$RESULT/verified-test.json"
|
||||
```
|
||||
|
||||
使用原目录运行相同命令即可续跑。筛选和测试将按已保存的题号继续。训练使用已保存的优化器和训练步。
|
||||
|
||||
筛选续跑可加 `--execution-batch-prompts 2`。它会重跑已完成的前两题,要求所有配置的 token 序列、停止原因与判分逐项一致,才继续处理剩余题目,并把回放凭证写入 `execution-batch-replay.json`。冻结的 `--batch-prompts 1` 参数仍用于校验原实验。双题模式超出资源限制或未通过回放时,可用原单题命令从已保存的行继续。本次在第五题写盘后交接,前两题的四个配置均通过了完整回放核对。
|
||||
|
||||
服务器约有 1.7 GiB 内存。前五题采用单题批量,从第六题起采用通过回放的双题批量。每道题的四个配置共享权重读取。前两次预检和一次生成在服务器仍有约 1 GiB 可用内存时触发进程独立换页上限。当前作业沿用原冻结题集,并在每层结束时释放空闲内存。可用内存、进程 RSS、低可用内存下的持续换页压力和运行时间均由原检查器监控。
|
||||
@@ -0,0 +1,46 @@
|
||||
# 完整答案下的 3–5 层共享实验
|
||||
|
||||
开发集筛选选定表中数值查找和三个接收层 `[15, 19, 23]`,层号从 0 起算。原模型在查表组答对 8/8,3 层直接共享在这八题上都生成了用结束 token 收尾的错误整数。该条件用于后续 LiSA 训练和独立留出评估。
|
||||
|
||||
## 开发集筛选
|
||||
|
||||
每个任务各有八题。共享列依次列出正确数、原模型答对却在直接共享后得到错误整数的题数,以及未提取到答案的题数。
|
||||
|
||||
| 任务 | 原模型正确 | 3 层共享 | 4 层共享 | 5 层共享 |
|
||||
| --- | ---: | ---: | ---: | ---: |
|
||||
| 查表 | 8 | 0 / 8 / 0 | 0 / 4 / 4 | 0 / 0 / 8 |
|
||||
| 重复键最后值 | 6 | 0 / 6 / 0 | 0 / 3 / 4 | 0 / 0 / 8 |
|
||||
| 加法 | 7 | 0 / 7 / 0 | 0 / 1 / 7 | 0 / 0 / 8 |
|
||||
| 重复项计数 | 1 | 1 / 1 / 0 | 0 / 1 / 0 | 0 / 0 / 8 |
|
||||
|
||||
5 层配置的 32 道生成均达到 24-token 上限。3 层对查表、重复键和加法均达到筛选门槛,查表中从正确变成错误整数的题数最多。筛选结果用于选择条件。留出集将另行估计准确率差、恢复题和新增错误。
|
||||
|
||||
独立复核用原分词器重新解析 32 道题的全部四组 token 序列,核对终止原因和正确性。冻结清单、逐题生成、组内汇总、选择记录和训练配置均已归档。 [实验协议](LISA_FULL_ANSWER_PROTOCOL.md) · [原始数据](../results/lisa-full-answer-reproduction/)
|
||||
|
||||
## 训练与独立留出评估
|
||||
|
||||
三个接收层各训练 825,344 个参数,总计 2,476,032 个。完成了 24 道冻结拟合题的教师分数采集,复核按题检查输入 token、教师张量形状与有限值,并保存各采集文件的 SHA-256。
|
||||
|
||||
两轮各完成 24 次更新。用冻结分词器重新解码两轮各 8 道验证题的生成结果,首轮答对 1 道,第二轮答对 2 道。按预先固定的验证正确数选用第二轮检查点。两轮逐步损失、验证题原始输出及检查点选择见训练记录。 [训练记录](../results/lisa-full-answer-reproduction/trace.json)
|
||||
|
||||
### 留出集结果
|
||||
|
||||
在 32 道独立查表题上,三组共 96 条回答全部生成了正常的结束 token,并能提取完整整数。原模型全对。三层直接共享让 32 道题都答成了错误整数,LiSA 救回其中 3 道,另外 29 道仍答错。
|
||||
|
||||
| 配置 | 正确数 | 准确率 |
|
||||
| --- | ---: | ---: |
|
||||
| 原模型 | 32/32 | 100% |
|
||||
| 三层直接共享 | 0/32 | 0% |
|
||||
| 三层 LiSA | 3/32 | 9.38% |
|
||||
|
||||
| 恢复题 | 原模型及标准答案 | 直接共享 | LiSA |
|
||||
| --- | ---: | ---: | ---: |
|
||||
| `test-lookup-014` | 71 | 47 | 71 |
|
||||
| `test-lookup-020` | 94 | 5 | 94 |
|
||||
| `test-lookup-021` | 44 | 10 | 44 |
|
||||
|
||||
相对直接共享,LiSA 准确率提高 9.38 个百分点,按题配对 bootstrap 95% 区间为 0 至 21.88 个百分点。McNemar 精确双侧检验的 p 值为 0.25。逐题变化方向是 3 道从错变对、0 道从对变错。直接共享全错,因此这个留出集无法估计 LiSA 保留直接共享已有正确答案的能力。
|
||||
|
||||
结果确认了三个真实数值错误的恢复案例。样本上的准确率提升仍有较大不确定性。结论限于这一个 Qwen3.5-2B 检查点、查表任务和三个接收层,训练用 24 道合成题。四层和五层共享只做了开发筛选,其 LiSA 恢复效果仍待测。
|
||||
|
||||
远程实验和独立复核均以退出码 0 完成。复核从保存的 token 重新解析并重算三组分数,结果与训练进程生成的汇总一致。摘要记录的是远程原件路径,选中的适配器保存在该远程运行目录。 [逐题输出](../results/lisa-full-answer-reproduction/test-items.json) · [配对统计](../results/lisa-full-answer-reproduction/test-audit.json) · [复核回执](../results/lisa-full-answer-reproduction/verified-test.json) · [文件摘要](../results/lisa-full-answer-reproduction/result.sha256)
|
||||
@@ -0,0 +1,38 @@
|
||||
# 查表任务的分数路径干预
|
||||
|
||||
使用冻结的三层 LiSA 与原底座,先在原 16 道诊断题逐 token 重放基线和第 19 层整层恢复。两组均须与既有生成完全相同。之后在新诊断题上分别干预第 19、15 层。读取和输出给下一全注意力层的分数可独立取原生或 LiSA 值;两套分数均在当前隐藏状态上计算。局部读取的改变仍会通过残差流影响下游。
|
||||
|
||||
冻结题集 SHA-256 为 c309f8721534b1f229a00ff556b48495c4e074be45c1905389aa57e9e3ddb048。诊断使用 8 张独立表,最终评估使用另外 32 张。每张表测两种反事实:保持查询键、交换两项数值,以及保持原表、切换查询键。两种测法共用第一个提示词,分别统计,合并推断以整张表为重采样单位。每次生成从头解码完整整数;首位正确数字概率在生成前使用完整词表计算。
|
||||
|
||||
诊断分支判据以第 19 层的逐表双正确为先,完整答案数为同分判据。在两个任务类型上合计(双正确分别计数),单路径超过基线时检验得分较高的单路径,同分优先读取;若只有联合条件超过基线,保留四组分析联合效应。第 15 层用于独立层位对照。诊断排序只选择下一步干预,不构成显著性检验。留出集开启前固定所选组、同预算对照及成本口径。最终报告逐题得失、表内错键、首位概率与按表配对的区间,区分模拟恢复开销与部署成本。
|
||||
|
||||
第 19 层有 8 个查询头、2 个 KV 组。若读取分支入选,分别恢复对应同一 KV 头的 4 个查询头,按上述诊断顺序选择,平局取第 0 组。用固定种子 120203 在两组中等概率抽取随机对照,并公布两个组的成绩。若抽中的恰好是所选组,随机组不提供独立对照,另一个组仍提供相同预算比较。若传递分支入选,把相同的原生分数交换两个 GQA 组再向下传,保持分数计算次数与数值集合相同。所有局部恢复均同时计算完整原生与 LiSA 分数后再选取;此实现用于诊断,不将选择半数头计为实际节省了一半算力。
|
||||
|
||||
### 原生计算成本与统计口径
|
||||
|
||||
每个干预条件都保留完整 LiSA 前向。额外的原生投影按本实现的真实形状计算:输入宽度 2048,打包的 Q/gate 输出宽度 4096,K 输出宽度 512,每个处理位置多用 9,437,184 次乘加。打包投影中的 gate 部分也实际执行,随后丢弃。每个 query-key 位置对的原生点积另需 8 × 256 = 2048 次乘加;预填充实际形成完整方阵,包含随后才被掩蔽的位置。原生 K 缓存增加每位置 512 个 float32 数。若将来只计算一个 GQA 组且复用已有 gate,每位置额外投影可降为 2048 × (1024 + 256) 次乘加,点积降为每位置对 1024 次乘加。这是理想裁剪后的算术量,运行中的诊断实现仍使用完整组。此处只计投影与点积,排除归一化、旋转、掩蔽、数据搬运和机器延时。
|
||||
|
||||
最终区间以整张表为单位固定种子重采样 10,000 次。对所有条件用相同的重采样索引,并分别列出两种题型。汇总指标给两种题型等权,同一张表的共用原题始终在同一重采样单元内。交互量为“两路同时恢复 − 只恢复读取 − 只恢复传递 + 基线”。逐题给出实际输出、目标键、错读键或表外数字,便于重新判分。
|
||||
|
||||
### 复跑与断点续算
|
||||
|
||||
在实验机的仓库根目录使用已有的 CPU 环境。下列命令可从空输出目录完整复跑。已有答卷时,评估程序核对题号、金标、生成 token 和判分,再从下一对题继续。应在同一输出目录使用同一把锁。最终核验要求所选各组的全部留出答卷均已生成。
|
||||
|
||||
```sh
|
||||
runs=/opt/exp-model-parameter-similarity/runs
|
||||
source_dir=$runs/cpu-qwen35-2b
|
||||
prior=$runs/lisa-full-answer-20261124-run
|
||||
previous=$runs/lisa-combinations-72501
|
||||
output=$runs/lisa-score-paths-120201
|
||||
mkdir -p "$output"
|
||||
export OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1
|
||||
flock "$output/worker.lock" /opt/exp-model-parameter-similarity/venv/bin/python -Bu \
|
||||
-m crossqkv.lisa_score_paths --source "$source_dir" --prior "$prior" \
|
||||
--previous "$previous" --out "$output" --follow-through
|
||||
/opt/exp-model-parameter-similarity/venv/bin/python -B -m crossqkv.lisa_score_paths_audit \
|
||||
"$output" --tokenizer "$source_dir/tokenizer.json" --frozen "$prior/frozen.json"
|
||||
```
|
||||
|
||||
### 链上恢复与单层共享的反向对照
|
||||
|
||||
在任何新诊断答案产生之前,增加四个诊断条件,逐一开启第 15、19 层的已训练 LiSA,第 23 层均使用原生注意力。按两层开关依次得到全原生、只共享 15、只共享 19、共享 15 和 19。均使用同一批 8 张诊断表和完整生成。只共享 19 时,适配器读取第 15 层的原生分数;同时共享 15 和 19 时,第 19 层也收到共享后的供给分数以及上游改变的隐藏状态。比较只共享 19 与全原生,可检验当前权重下单层共享是否足以损害查表;比较双层条件与两个单层条件,可估计两处共享的交互。诊断结果需限定在当前适配器及任务分布,四个补充条件均不参与留出组的选择。
|
||||
@@ -0,0 +1,7 @@
|
||||
# LiSA 查表分数路径实验结果
|
||||
|
||||
## 旧诊断题端点重放
|
||||
|
||||
同一份 Qwen3.5-2B 和同一份冻结 LiSA 在旧诊断集上重放 8 对题。原 LiSA 的 16 份答卷逐 token 与归档相同,完整答案全错。只在第 19 层同时恢复本层读取与向第 23 层传递的原生分数,另 16 份答卷也逐 token 与旧恢复组相同,完整答案全对。两组正确首位数字的概率相对既有全词表评分,最大绝对差分别为 0.00000136 和 0.00000241。核验还比较了题号、金标、终止原因及整数解析。[基线答卷](../results/lisa-score-paths/replay-19-baseline-old.json) · [恢复组答卷](../results/lisa-score-paths/replay-19-both-old.json) · [哈希与核验结果](../results/lisa-score-paths/replay-verified.json)
|
||||
|
||||
这批题曾用于选层,重放检验的是实现一致性。区分本层读取、分数传递和单层共享损伤的实验采用另外生成的表。[实验协议](LISA_SCORE_PATHS.md)
|
||||
+6
-2
@@ -77,11 +77,13 @@ def attention(q, k, v):
|
||||
|
||||
|
||||
class StreamingLM:
|
||||
def __init__(self, weights, config, seconds=7200, enforce_memory=True):
|
||||
def __init__(self, weights, config, seconds=7200, enforce_memory=True,
|
||||
process_swap_limit_kib=128*1024):
|
||||
self.tensors = load_tensors(Path(weights))
|
||||
self.config = config.get('text_config', config)
|
||||
self.deadline = time.monotonic() + seconds
|
||||
self.enforce_memory = enforce_memory
|
||||
self.process_swap_limit_kib = process_swap_limit_kib
|
||||
self.eps = self.config['rms_norm_eps']
|
||||
self.norm_replacement = None
|
||||
self.capture_qk = False
|
||||
@@ -107,7 +109,9 @@ class StreamingLM:
|
||||
rate = (count-self.swap_observation[1])*4096/elapsed
|
||||
self.swap_pressure_windows = self.swap_pressure_windows+1 if rate > 4*1024**2 else 0
|
||||
own_swap_kib = int(status.get('VmSwap', '0 kB').split()[0])
|
||||
if self.swap_pressure_windows >= 3 and (available < 384*1024 or own_swap_kib > 128*1024):
|
||||
over_process_limit = (self.process_swap_limit_kib is not None
|
||||
and own_swap_kib > self.process_swap_limit_kib)
|
||||
if self.swap_pressure_windows >= 3 and (available < 384*1024 or over_process_limit):
|
||||
raise MemoryError(f'Sustained host swap pressure plus constrained memory: available={available} KiB, process_swap={own_swap_kib} KiB')
|
||||
self.swap_observation = (now,count)
|
||||
if rss_kib > 512*1024 or available < 256*1024:
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# Qwen3.5-2B 跨层注意力共享先导实验
|
||||
|
||||
固定原 Qwen3.5-2B 检查点,测试第 19 层实际前向产生的 softmax 前注意力分数能否替代第 23 层的分数。层编号从零开始。所有替换保留接收端的 V、gate 和输出投影。
|
||||
|
||||
| 方法 | 4 项表正确 | 8 项表正确 | 合计选择 NLL |
|
||||
| --- | ---: | ---: | ---: |
|
||||
| 原模型 | 12/12 | 12/12 | 0.145079 |
|
||||
| 原序直接共享 | 12/12 | 12/12 | 0.087006 |
|
||||
| 头重排后共享 | 12/12 | 12/12 | 0.093331 |
|
||||
| 共享分数的线性头混合 | 12/12 | 12/12 | 0.100784 |
|
||||
| 接收层 32 坐标,无共享 | 12/12 | 12/12 | 0.102878 |
|
||||
| 共享分数与接收层 32 坐标联合拟合 | 12/12 | 12/12 | 0.106184 |
|
||||
|
||||
选择 NLL 在四个选项 token 上归一化后按题取均值。直接共享在这 24 道题上保持准确率,也在每道题上降低了选择 NLL。更低的损失反映正确选项相对其余三个选项的得分,样本中的准确率已经达到上限。这个结果支持冻结权重的单层替换在这些合成检索题上可用。轻量拟合没有带来额外收益。
|
||||
|
||||
## 实验与检查
|
||||
|
||||
- 12 道 4 项表校准题用于冻结头排列、闭式岭回归映射。拟合只使用原模型内部注意力分数,不使用正确选项标签。全套 36 条提示词无重复。
|
||||
- Qwen 权重全程冻结。没有反向传播,也没有训练 LiSA 原版的非线性头对齐网络或低秩 Q/K 投影。32 坐标来自确定性下采样的接收层 post-RoPE Q/K。
|
||||
- 远程 CPU 的 8 项跨层回归测试通过。合成数值检查通过,覆盖排列方向、因果遮罩和联合拟合重建。校准时的原模型路径一致性检查以及六批留出题的末层原样重放一致性检查均通过。
|
||||
- 两次较慢的远程执行切换后保留旧目录,最终版本沿用第二次已完成的校准,并核对原检查点文件指纹及全部提示词。末层重放阶段耗时约 681 秒。逐题分数、答案和 NLL 已从原始 logits 独立复核,最终运行脚本 SHA256 为 `a64d1b50a10bdde893c4bc274365c0c072f13c0a2359b079cfa8421b9ce068f4`。
|
||||
|
||||
评测只覆盖一个模型、一个接收层、一类合成任务、约束于四个选项的读出。诊断仍计算原始 Q/K,未测吞吐、压缩率、自由生成或多层累积替换效果。实验方法和复现入口见 [crossqkv/README.md](../../crossqkv/README.md)。
|
||||
@@ -0,0 +1,338 @@
|
||||
{
|
||||
"permutation": [
|
||||
0,
|
||||
2,
|
||||
4,
|
||||
3,
|
||||
7,
|
||||
6,
|
||||
5,
|
||||
1
|
||||
],
|
||||
"mix": [
|
||||
[
|
||||
0.24426038563251495,
|
||||
0.055573295801877975,
|
||||
-0.12299608439207077,
|
||||
-0.09282179176807404,
|
||||
-0.047870442271232605,
|
||||
0.07772502303123474,
|
||||
-0.22192631661891937,
|
||||
0.29638272523880005
|
||||
],
|
||||
[
|
||||
0.03558433800935745,
|
||||
0.03896130993962288,
|
||||
-0.18795007467269897,
|
||||
0.002625135239213705,
|
||||
-0.16552278399467468,
|
||||
-0.023057416081428528,
|
||||
-0.39929720759391785,
|
||||
0.43178120255470276
|
||||
],
|
||||
[
|
||||
0.1871931552886963,
|
||||
0.44749122858047485,
|
||||
-0.04751807823777199,
|
||||
0.04143448546528816,
|
||||
0.23914210498332977,
|
||||
0.18653616309165955,
|
||||
0.12161331623792648,
|
||||
-0.20545999705791473
|
||||
],
|
||||
[
|
||||
-0.027203943580389023,
|
||||
-0.23345178365707397,
|
||||
-0.03906247019767761,
|
||||
0.0939483568072319,
|
||||
0.11926761269569397,
|
||||
-0.08872664719820023,
|
||||
0.14460818469524384,
|
||||
0.06796323508024216
|
||||
],
|
||||
[
|
||||
0.09347549825906754,
|
||||
0.2144748717546463,
|
||||
1.078420877456665,
|
||||
0.5173454880714417,
|
||||
0.5393254160881042,
|
||||
0.31546834111213684,
|
||||
0.7830604314804077,
|
||||
0.09864718466997147
|
||||
],
|
||||
[
|
||||
-0.015639908611774445,
|
||||
0.13545557856559753,
|
||||
0.20001526176929474,
|
||||
-0.0403873436152935,
|
||||
-0.14243841171264648,
|
||||
0.10669009387493134,
|
||||
0.22260507941246033,
|
||||
-0.008936765603721142
|
||||
],
|
||||
[
|
||||
0.2405557930469513,
|
||||
0.054704487323760986,
|
||||
0.011206595227122307,
|
||||
0.2406461238861084,
|
||||
-0.026383306831121445,
|
||||
0.25195246934890747,
|
||||
0.09300804138183594,
|
||||
0.10066510736942291
|
||||
],
|
||||
[
|
||||
0.02644052356481552,
|
||||
0.10034456104040146,
|
||||
0.07825803011655807,
|
||||
0.10650064051151276,
|
||||
0.3668587803840637,
|
||||
-0.007412006612867117,
|
||||
0.061572253704071045,
|
||||
-0.06577901542186737
|
||||
]
|
||||
],
|
||||
"local32": [
|
||||
[
|
||||
0.2867194414138794,
|
||||
0.06671284139156342,
|
||||
-0.2674592435359955,
|
||||
-0.3276604115962982,
|
||||
-0.4070841670036316,
|
||||
-0.006673475727438927,
|
||||
-0.2074313908815384,
|
||||
0.12887436151504517
|
||||
],
|
||||
[
|
||||
-0.0516749806702137,
|
||||
0.4364052712917328,
|
||||
0.4763493239879608,
|
||||
0.569825291633606,
|
||||
0.5895766019821167,
|
||||
0.23220211267471313,
|
||||
0.4529169201850891,
|
||||
0.020792270079255104
|
||||
],
|
||||
[
|
||||
0.030566174536943436,
|
||||
-0.0014433575561270118,
|
||||
0.9291507601737976,
|
||||
0.07762160897254944,
|
||||
0.09363061934709549,
|
||||
0.11929107457399368,
|
||||
0.6625307202339172,
|
||||
0.011318162083625793
|
||||
],
|
||||
[
|
||||
0.6921118497848511,
|
||||
0.3367474377155304,
|
||||
-0.20861877501010895,
|
||||
0.6061498522758484,
|
||||
0.4020693004131317,
|
||||
0.4614187479019165,
|
||||
-0.120954729616642,
|
||||
0.6977306008338928
|
||||
],
|
||||
[
|
||||
0.010575470514595509,
|
||||
0.03395608440041542,
|
||||
-0.17418035864830017,
|
||||
0.05686786770820618,
|
||||
0.3456997573375702,
|
||||
-0.16309495270252228,
|
||||
0.13770024478435516,
|
||||
-0.06023705378174782
|
||||
],
|
||||
[
|
||||
0.34056422114372253,
|
||||
0.3800618350505829,
|
||||
0.46083998680114746,
|
||||
0.379044771194458,
|
||||
0.38687247037887573,
|
||||
0.7362816333770752,
|
||||
0.2947295904159546,
|
||||
-0.053121648728847504
|
||||
],
|
||||
[
|
||||
0.03288573399186134,
|
||||
0.11208789050579071,
|
||||
0.5949627161026001,
|
||||
0.09720376133918762,
|
||||
0.012026847340166569,
|
||||
0.062014296650886536,
|
||||
0.8560540080070496,
|
||||
0.004886063747107983
|
||||
],
|
||||
[
|
||||
0.3228500783443451,
|
||||
0.3110385239124298,
|
||||
-0.03597158193588257,
|
||||
0.004630092531442642,
|
||||
0.1255260556936264,
|
||||
0.3001147508621216,
|
||||
-0.2873961925506592,
|
||||
0.7489231824874878
|
||||
]
|
||||
],
|
||||
"mix_local32": [
|
||||
[
|
||||
0.11679738759994507,
|
||||
0.06494305282831192,
|
||||
-0.07491274178028107,
|
||||
-0.10080373287200928,
|
||||
-0.02167605608701706,
|
||||
-0.05343199521303177,
|
||||
-0.1710113286972046,
|
||||
0.25583943724632263
|
||||
],
|
||||
[
|
||||
0.07517975568771362,
|
||||
0.04044078290462494,
|
||||
-0.06897048652172089,
|
||||
0.022282306104898453,
|
||||
-0.14309072494506836,
|
||||
0.033187106251716614,
|
||||
-0.3017081618309021,
|
||||
0.44381454586982727
|
||||
],
|
||||
[
|
||||
0.06857457011938095,
|
||||
0.3892330229282379,
|
||||
-0.10634169727563858,
|
||||
-0.019304350018501282,
|
||||
0.19891692698001862,
|
||||
0.07254264503717422,
|
||||
0.06347434967756271,
|
||||
-0.31816524267196655
|
||||
],
|
||||
[
|
||||
0.09148014336824417,
|
||||
-0.1973782479763031,
|
||||
0.152879536151886,
|
||||
0.11245211213827133,
|
||||
0.12135685235261917,
|
||||
0.12074458599090576,
|
||||
0.3753202259540558,
|
||||
0.044213682413101196
|
||||
],
|
||||
[
|
||||
0.07850243151187897,
|
||||
0.17286451160907745,
|
||||
0.8361716866493225,
|
||||
0.4728657901287079,
|
||||
0.4632956087589264,
|
||||
0.20232141017913818,
|
||||
0.5647081732749939,
|
||||
0.14378811419010162
|
||||
],
|
||||
[
|
||||
-0.08318367600440979,
|
||||
0.05281839147210121,
|
||||
-0.0541967898607254,
|
||||
-0.07725174725055695,
|
||||
-0.19812145829200745,
|
||||
-0.0031219127122312784,
|
||||
-0.04434914141893387,
|
||||
-0.08314008265733719
|
||||
],
|
||||
[
|
||||
0.21213339269161224,
|
||||
0.07709750533103943,
|
||||
0.045971959829330444,
|
||||
0.21323992311954498,
|
||||
0.025503091514110565,
|
||||
0.26300355792045593,
|
||||
0.12342528253793716,
|
||||
0.12137588858604431
|
||||
],
|
||||
[
|
||||
0.09544969350099564,
|
||||
0.0986594632267952,
|
||||
0.04683060944080353,
|
||||
0.12203476577997208,
|
||||
0.31474506855010986,
|
||||
0.005084820557385683,
|
||||
0.022342870011925697,
|
||||
-0.03607412800192833
|
||||
],
|
||||
[
|
||||
0.5112781524658203,
|
||||
0.1685691624879837,
|
||||
0.03565533459186554,
|
||||
-0.017969932407140732,
|
||||
-0.11261212080717087,
|
||||
0.21835851669311523,
|
||||
0.06214938685297966,
|
||||
0.369602233171463
|
||||
],
|
||||
[
|
||||
-0.40601295232772827,
|
||||
0.12985582649707794,
|
||||
-0.03226114436984062,
|
||||
0.0588277243077755,
|
||||
0.1966109573841095,
|
||||
-0.195071741938591,
|
||||
0.021230820566415787,
|
||||
-0.3407396376132965
|
||||
],
|
||||
[
|
||||
0.05574870482087135,
|
||||
0.002938202116638422,
|
||||
0.8687096834182739,
|
||||
0.05353480949997902,
|
||||
0.06125132739543915,
|
||||
0.1233755350112915,
|
||||
0.607818603515625,
|
||||
0.06634242087602615
|
||||
],
|
||||
[
|
||||
0.17747589945793152,
|
||||
-0.11643446981906891,
|
||||
-0.4716564118862152,
|
||||
0.21365293860435486,
|
||||
-0.053643301129341125,
|
||||
0.035281628370285034,
|
||||
-0.4258069097995758,
|
||||
0.28920620679855347
|
||||
],
|
||||
[
|
||||
-0.07137177139520645,
|
||||
-0.0010721894213929772,
|
||||
-0.30434563755989075,
|
||||
-0.04535682126879692,
|
||||
0.11665429919958115,
|
||||
-0.21108229458332062,
|
||||
-0.05042998865246773,
|
||||
-0.023268967866897583
|
||||
],
|
||||
[
|
||||
0.20552901923656464,
|
||||
0.10354588180780411,
|
||||
0.18191908299922943,
|
||||
0.15948699414730072,
|
||||
0.154840886592865,
|
||||
0.581689715385437,
|
||||
0.12202811241149902,
|
||||
-0.10293511301279068
|
||||
],
|
||||
[
|
||||
0.015075353905558586,
|
||||
0.04981930926442146,
|
||||
0.5468234419822693,
|
||||
0.05587880685925484,
|
||||
-0.008960379287600517,
|
||||
0.026398485526442528,
|
||||
0.831177294254303,
|
||||
0.0010817323345690966
|
||||
],
|
||||
[
|
||||
0.2027735859155655,
|
||||
0.22851699590682983,
|
||||
0.04834882915019989,
|
||||
-0.009833958931267262,
|
||||
0.15699052810668945,
|
||||
0.20191335678100586,
|
||||
-0.24067029356956482,
|
||||
0.5740934014320374
|
||||
]
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,260 @@
|
||||
{
|
||||
"calibration": [
|
||||
{
|
||||
"id": "calibration-000",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nbirch: 19\nfern: 45\ndune: 31\nlarch: 86\nWhich option is the value for birch?\n1. 19\n2. 31\n3. 45\n4. 86\nAnswer:",
|
||||
"answer_index": 0,
|
||||
"evidence_position": 0,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "calibration-001",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nnettle: 34\npine: 47\nmaple: 93\nkelp: 83\nWhich option is the value for pine?\n1. 34\n2. 93\n3. 47\n4. 83\nAnswer:",
|
||||
"answer_index": 2,
|
||||
"evidence_position": 1,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "calibration-002",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nfern: 93\ncedar: 38\niris: 53\nnettle: 61\nWhich option is the value for iris?\n1. 61\n2. 53\n3. 93\n4. 38\nAnswer:",
|
||||
"answer_index": 1,
|
||||
"evidence_position": 2,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "calibration-003",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nfern: 19\nelm: 52\ngrove: 13\nolive: 39\nWhich option is the value for olive?\n1. 13\n2. 19\n3. 52\n4. 39\nAnswer:",
|
||||
"answer_index": 3,
|
||||
"evidence_position": 3,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "calibration-004",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nlarch: 24\ndune: 97\npine: 13\nolive: 57\nWhich option is the value for larch?\n1. 13\n2. 57\n3. 97\n4. 24\nAnswer:",
|
||||
"answer_index": 3,
|
||||
"evidence_position": 0,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "calibration-005",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nfern: 90\nmaple: 72\nbirch: 81\nolive: 65\nWhich option is the value for maple?\n1. 65\n2. 72\n3. 81\n4. 90\nAnswer:",
|
||||
"answer_index": 1,
|
||||
"evidence_position": 1,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "calibration-006",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nlarch: 19\nbirch: 40\ndune: 14\namber: 53\nWhich option is the value for dune?\n1. 14\n2. 40\n3. 53\n4. 19\nAnswer:",
|
||||
"answer_index": 0,
|
||||
"evidence_position": 2,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "calibration-007",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nbirch: 47\nkelp: 15\niris: 95\nmaple: 25\nWhich option is the value for maple?\n1. 95\n2. 47\n3. 15\n4. 25\nAnswer:",
|
||||
"answer_index": 3,
|
||||
"evidence_position": 3,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "calibration-008",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nelm: 78\niris: 49\njade: 61\npine: 46\nWhich option is the value for elm?\n1. 46\n2. 61\n3. 78\n4. 49\nAnswer:",
|
||||
"answer_index": 2,
|
||||
"evidence_position": 0,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "calibration-009",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nbirch: 51\niris: 80\ncedar: 81\nfern: 54\nWhich option is the value for iris?\n1. 80\n2. 81\n3. 54\n4. 51\nAnswer:",
|
||||
"answer_index": 0,
|
||||
"evidence_position": 1,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "calibration-010",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nheath: 69\ncedar: 80\nbirch: 37\ndune: 19\nWhich option is the value for birch?\n1. 69\n2. 80\n3. 37\n4. 19\nAnswer:",
|
||||
"answer_index": 2,
|
||||
"evidence_position": 2,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "calibration-011",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nbirch: 89\njade: 86\nfern: 65\ncedar: 20\nWhich option is the value for cedar?\n1. 65\n2. 20\n3. 89\n4. 86\nAnswer:",
|
||||
"answer_index": 1,
|
||||
"evidence_position": 3,
|
||||
"entries": 4
|
||||
}
|
||||
],
|
||||
"test4": [
|
||||
{
|
||||
"id": "test4-000",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\ngrove: 25\namber: 97\ndune: 93\nheath: 80\nWhich option is the value for grove?\n1. 97\n2. 80\n3. 25\n4. 93\nAnswer:",
|
||||
"answer_index": 2,
|
||||
"evidence_position": 0,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "test4-001",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nkelp: 50\nelm: 92\ngrove: 27\nnettle: 46\nWhich option is the value for elm?\n1. 27\n2. 50\n3. 92\n4. 46\nAnswer:",
|
||||
"answer_index": 2,
|
||||
"evidence_position": 1,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "test4-002",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nmaple: 64\nolive: 99\nbirch: 95\nelm: 31\nWhich option is the value for birch?\n1. 64\n2. 31\n3. 99\n4. 95\nAnswer:",
|
||||
"answer_index": 3,
|
||||
"evidence_position": 2,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "test4-003",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nkelp: 95\nmaple: 88\niris: 77\nlarch: 57\nWhich option is the value for larch?\n1. 77\n2. 57\n3. 95\n4. 88\nAnswer:",
|
||||
"answer_index": 1,
|
||||
"evidence_position": 3,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "test4-004",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\ndune: 51\ncedar: 55\nlarch: 98\nnettle: 94\nWhich option is the value for dune?\n1. 51\n2. 94\n3. 55\n4. 98\nAnswer:",
|
||||
"answer_index": 0,
|
||||
"evidence_position": 0,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "test4-005",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nelm: 42\nolive: 46\nheath: 11\ndune: 54\nWhich option is the value for olive?\n1. 11\n2. 46\n3. 42\n4. 54\nAnswer:",
|
||||
"answer_index": 1,
|
||||
"evidence_position": 1,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "test4-006",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nmaple: 94\ndune: 40\npine: 76\njade: 10\nWhich option is the value for pine?\n1. 10\n2. 94\n3. 76\n4. 40\nAnswer:",
|
||||
"answer_index": 2,
|
||||
"evidence_position": 2,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "test4-007",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nkelp: 54\niris: 92\npine: 11\ncedar: 13\nWhich option is the value for cedar?\n1. 13\n2. 11\n3. 54\n4. 92\nAnswer:",
|
||||
"answer_index": 0,
|
||||
"evidence_position": 3,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "test4-008",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nlarch: 40\nelm: 91\nbirch: 30\npine: 78\nWhich option is the value for larch?\n1. 30\n2. 40\n3. 78\n4. 91\nAnswer:",
|
||||
"answer_index": 1,
|
||||
"evidence_position": 0,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "test4-009",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\njade: 66\npine: 45\nkelp: 46\nheath: 52\nWhich option is the value for pine?\n1. 66\n2. 52\n3. 46\n4. 45\nAnswer:",
|
||||
"answer_index": 3,
|
||||
"evidence_position": 1,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "test4-010",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\namber: 93\ndune: 32\nheath: 72\njade: 46\nWhich option is the value for heath?\n1. 32\n2. 46\n3. 93\n4. 72\nAnswer:",
|
||||
"answer_index": 3,
|
||||
"evidence_position": 2,
|
||||
"entries": 4
|
||||
},
|
||||
{
|
||||
"id": "test4-011",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nnettle: 99\nfern: 36\nbirch: 49\nolive: 25\nWhich option is the value for olive?\n1. 25\n2. 99\n3. 49\n4. 36\nAnswer:",
|
||||
"answer_index": 0,
|
||||
"evidence_position": 3,
|
||||
"entries": 4
|
||||
}
|
||||
],
|
||||
"test8": [
|
||||
{
|
||||
"id": "test8-000",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\ncedar: 53\ndune: 77\nelm: 44\nmaple: 93\nlarch: 39\nheath: 78\ngrove: 41\nbirch: 48\nWhich option is the value for cedar?\n1. 77\n2. 48\n3. 53\n4. 41\nAnswer:",
|
||||
"answer_index": 2,
|
||||
"evidence_position": 0,
|
||||
"entries": 8
|
||||
},
|
||||
{
|
||||
"id": "test8-001",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nolive: 87\nnettle: 76\nbirch: 44\nmaple: 69\npine: 41\ncedar: 56\ndune: 45\nkelp: 94\nWhich option is the value for nettle?\n1. 76\n2. 56\n3. 41\n4. 94\nAnswer:",
|
||||
"answer_index": 0,
|
||||
"evidence_position": 1,
|
||||
"entries": 8
|
||||
},
|
||||
{
|
||||
"id": "test8-002",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nmaple: 80\nbirch: 21\nfern: 75\ngrove: 52\ncedar: 59\niris: 73\njade: 32\npine: 83\nWhich option is the value for fern?\n1. 32\n2. 80\n3. 75\n4. 73\nAnswer:",
|
||||
"answer_index": 2,
|
||||
"evidence_position": 2,
|
||||
"entries": 8
|
||||
},
|
||||
{
|
||||
"id": "test8-003",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nlarch: 91\nbirch: 39\nheath: 27\npine: 96\nkelp: 49\nolive: 85\nelm: 18\nmaple: 66\nWhich option is the value for pine?\n1. 66\n2. 96\n3. 49\n4. 18\nAnswer:",
|
||||
"answer_index": 1,
|
||||
"evidence_position": 3,
|
||||
"entries": 8
|
||||
},
|
||||
{
|
||||
"id": "test8-004",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\ncedar: 19\nbirch: 84\nkelp: 85\njade: 72\nnettle: 87\niris: 96\nmaple: 56\nheath: 95\nWhich option is the value for nettle?\n1. 85\n2. 87\n3. 95\n4. 19\nAnswer:",
|
||||
"answer_index": 1,
|
||||
"evidence_position": 4,
|
||||
"entries": 8
|
||||
},
|
||||
{
|
||||
"id": "test8-005",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\niris: 36\nnettle: 41\nfern: 96\nmaple: 84\nheath: 37\npine: 57\ndune: 17\nbirch: 46\nWhich option is the value for pine?\n1. 17\n2. 37\n3. 41\n4. 57\nAnswer:",
|
||||
"answer_index": 3,
|
||||
"evidence_position": 5,
|
||||
"entries": 8
|
||||
},
|
||||
{
|
||||
"id": "test8-006",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nfern: 49\njade: 67\nnettle: 71\nmaple: 89\nbirch: 44\npine: 25\nkelp: 27\ngrove: 41\nWhich option is the value for kelp?\n1. 25\n2. 27\n3. 44\n4. 41\nAnswer:",
|
||||
"answer_index": 1,
|
||||
"evidence_position": 6,
|
||||
"entries": 8
|
||||
},
|
||||
{
|
||||
"id": "test8-007",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nnettle: 71\nolive: 95\nmaple: 16\niris: 54\njade: 61\namber: 72\nfern: 38\ngrove: 13\nWhich option is the value for grove?\n1. 72\n2. 38\n3. 13\n4. 95\nAnswer:",
|
||||
"answer_index": 2,
|
||||
"evidence_position": 7,
|
||||
"entries": 8
|
||||
},
|
||||
{
|
||||
"id": "test8-008",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\njade: 98\nkelp: 18\nelm: 84\niris: 67\nbirch: 64\nfern: 10\nlarch: 79\nmaple: 76\nWhich option is the value for jade?\n1. 10\n2. 67\n3. 84\n4. 98\nAnswer:",
|
||||
"answer_index": 3,
|
||||
"evidence_position": 0,
|
||||
"entries": 8
|
||||
},
|
||||
{
|
||||
"id": "test8-009",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\ngrove: 66\nheath: 58\nfern: 59\nmaple: 97\nolive: 52\namber: 29\nkelp: 24\ndune: 67\nWhich option is the value for heath?\n1. 58\n2. 59\n3. 67\n4. 52\nAnswer:",
|
||||
"answer_index": 0,
|
||||
"evidence_position": 1,
|
||||
"entries": 8
|
||||
},
|
||||
{
|
||||
"id": "test8-010",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nbirch: 52\namber: 72\ndune: 80\npine: 79\nfern: 32\nnettle: 14\nkelp: 84\nelm: 59\nWhich option is the value for dune?\n1. 52\n2. 84\n3. 72\n4. 80\nAnswer:",
|
||||
"answer_index": 3,
|
||||
"evidence_position": 2,
|
||||
"entries": 8
|
||||
},
|
||||
{
|
||||
"id": "test8-011",
|
||||
"prompt": "Use the lookup table. Answer with only the option number.\nfern: 26\ngrove: 47\nbirch: 58\ndune: 99\nmaple: 24\ncedar: 19\njade: 36\nkelp: 23\nWhich option is the value for dune?\n1. 99\n2. 36\n3. 23\n4. 58\nAnswer:",
|
||||
"answer_index": 0,
|
||||
"evidence_position": 3,
|
||||
"entries": 8
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"donor": 19,
|
||||
"target": 23,
|
||||
"local_coordinate_count": 32,
|
||||
"modes": [
|
||||
"native",
|
||||
"direct",
|
||||
"permutation",
|
||||
"mix",
|
||||
"local32",
|
||||
"mix_local32"
|
||||
],
|
||||
"source": "/opt/exp-model-parameter-similarity/runs/cpu-qwen35-2b",
|
||||
"source_sha256": {
|
||||
"model_config.json": "ed1c1723241f23f7f4e23430759cbd7dcfb4103cbdfe052bfe7626b57c2615b4",
|
||||
"tokenizer.json": "5f9e4d4901a92b997e463c1f46055088b6cca5ca61a6522d1b9f64c4bb81cb42",
|
||||
"manifest.json": "28efbaf94a5034333339a35f08ead151459a7d20c6c2d2f07a451e7f3bf154de"
|
||||
},
|
||||
"choice_nll_scope": "normalized over four option-number logits only"
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,95 @@
|
||||
{
|
||||
"sets": {
|
||||
"test4": {
|
||||
"native": {
|
||||
"n": 12,
|
||||
"correct": 12,
|
||||
"mean_choice_nll": 0.1577236725451122,
|
||||
"mean_margin": 2.6222333908081055,
|
||||
"prediction_agreement_with_native": 12
|
||||
},
|
||||
"direct": {
|
||||
"n": 12,
|
||||
"correct": 12,
|
||||
"mean_choice_nll": 0.09467621731363618,
|
||||
"mean_margin": 3.157541592915853,
|
||||
"prediction_agreement_with_native": 12
|
||||
},
|
||||
"permutation": {
|
||||
"n": 12,
|
||||
"correct": 12,
|
||||
"mean_choice_nll": 0.10225362466948813,
|
||||
"mean_margin": 3.069669246673584,
|
||||
"prediction_agreement_with_native": 12
|
||||
},
|
||||
"mix": {
|
||||
"n": 12,
|
||||
"correct": 12,
|
||||
"mean_choice_nll": 0.10946264729409035,
|
||||
"mean_margin": 2.9876694679260254,
|
||||
"prediction_agreement_with_native": 12
|
||||
},
|
||||
"local32": {
|
||||
"n": 12,
|
||||
"correct": 12,
|
||||
"mean_choice_nll": 0.11173090120474012,
|
||||
"mean_margin": 2.9486522674560547,
|
||||
"prediction_agreement_with_native": 12
|
||||
},
|
||||
"mix_local32": {
|
||||
"n": 12,
|
||||
"correct": 12,
|
||||
"mean_choice_nll": 0.1155495746250453,
|
||||
"mean_margin": 2.9375176429748535,
|
||||
"prediction_agreement_with_native": 12
|
||||
}
|
||||
},
|
||||
"test8": {
|
||||
"native": {
|
||||
"n": 12,
|
||||
"correct": 12,
|
||||
"mean_choice_nll": 0.13243424793047875,
|
||||
"mean_margin": 2.652334133783976,
|
||||
"prediction_agreement_with_native": 12
|
||||
},
|
||||
"direct": {
|
||||
"n": 12,
|
||||
"correct": 12,
|
||||
"mean_choice_nll": 0.07933497390150783,
|
||||
"mean_margin": 3.1618269284566245,
|
||||
"prediction_agreement_with_native": 12
|
||||
},
|
||||
"permutation": {
|
||||
"n": 12,
|
||||
"correct": 12,
|
||||
"mean_choice_nll": 0.08440917052410739,
|
||||
"mean_margin": 3.135169267654419,
|
||||
"prediction_agreement_with_native": 12
|
||||
},
|
||||
"mix": {
|
||||
"n": 12,
|
||||
"correct": 12,
|
||||
"mean_choice_nll": 0.09210604798693496,
|
||||
"mean_margin": 3.0242624282836914,
|
||||
"prediction_agreement_with_native": 12
|
||||
},
|
||||
"local32": {
|
||||
"n": 12,
|
||||
"correct": 12,
|
||||
"mean_choice_nll": 0.09402417229313187,
|
||||
"mean_margin": 2.9872288703918457,
|
||||
"prediction_agreement_with_native": 12
|
||||
},
|
||||
"mix_local32": {
|
||||
"n": 12,
|
||||
"correct": 12,
|
||||
"mean_choice_nll": 0.09681914153941336,
|
||||
"mean_margin": 2.970529397328695,
|
||||
"prediction_agreement_with_native": 12
|
||||
}
|
||||
}
|
||||
},
|
||||
"native_last_layer_replay_parity": true,
|
||||
"calibration_reused": true,
|
||||
"seconds": 681.1676366906613
|
||||
}
|
||||
@@ -0,0 +1,290 @@
|
||||
[
|
||||
{
|
||||
"id": "diagnostic-000-0",
|
||||
"task": "lookup",
|
||||
"gold": 76,
|
||||
"arms": {
|
||||
"baseline": {
|
||||
"tokens": [
|
||||
24,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"response": "94<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 94,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-000-1",
|
||||
"task": "lookup",
|
||||
"gold": 75,
|
||||
"arms": {
|
||||
"baseline": {
|
||||
"tokens": [
|
||||
24,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"response": "94<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 94,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-001-0",
|
||||
"task": "lookup",
|
||||
"gold": 39,
|
||||
"arms": {
|
||||
"baseline": {
|
||||
"tokens": [
|
||||
22,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "73<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 73,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-001-1",
|
||||
"task": "lookup",
|
||||
"gold": 76,
|
||||
"arms": {
|
||||
"baseline": {
|
||||
"tokens": [
|
||||
22,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "73<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 73,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-002-0",
|
||||
"task": "lookup",
|
||||
"gold": 49,
|
||||
"arms": {
|
||||
"baseline": {
|
||||
"tokens": [
|
||||
20,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "52<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 52,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-002-1",
|
||||
"task": "lookup",
|
||||
"gold": 22,
|
||||
"arms": {
|
||||
"baseline": {
|
||||
"tokens": [
|
||||
20,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "52<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 52,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-003-0",
|
||||
"task": "lookup",
|
||||
"gold": 63,
|
||||
"arms": {
|
||||
"baseline": {
|
||||
"tokens": [
|
||||
24,
|
||||
15,
|
||||
248046
|
||||
],
|
||||
"response": "90<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 90,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-003-1",
|
||||
"task": "lookup",
|
||||
"gold": 21,
|
||||
"arms": {
|
||||
"baseline": {
|
||||
"tokens": [
|
||||
24,
|
||||
15,
|
||||
248046
|
||||
],
|
||||
"response": "90<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 90,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-004-0",
|
||||
"task": "lookup",
|
||||
"gold": 74,
|
||||
"arms": {
|
||||
"baseline": {
|
||||
"tokens": [
|
||||
24,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "99<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 99,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-004-1",
|
||||
"task": "lookup",
|
||||
"gold": 29,
|
||||
"arms": {
|
||||
"baseline": {
|
||||
"tokens": [
|
||||
24,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "99<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 99,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-005-0",
|
||||
"task": "lookup",
|
||||
"gold": 39,
|
||||
"arms": {
|
||||
"baseline": {
|
||||
"tokens": [
|
||||
21,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "61<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 61,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-005-1",
|
||||
"task": "lookup",
|
||||
"gold": 77,
|
||||
"arms": {
|
||||
"baseline": {
|
||||
"tokens": [
|
||||
21,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "61<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 61,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-006-0",
|
||||
"task": "lookup",
|
||||
"gold": 40,
|
||||
"arms": {
|
||||
"baseline": {
|
||||
"tokens": [
|
||||
20,
|
||||
15,
|
||||
248046
|
||||
],
|
||||
"response": "50<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 50,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-006-1",
|
||||
"task": "lookup",
|
||||
"gold": 67,
|
||||
"arms": {
|
||||
"baseline": {
|
||||
"tokens": [
|
||||
20,
|
||||
15,
|
||||
248046
|
||||
],
|
||||
"response": "50<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 50,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-007-0",
|
||||
"task": "lookup",
|
||||
"gold": 89,
|
||||
"arms": {
|
||||
"baseline": {
|
||||
"tokens": [
|
||||
19,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "43<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 43,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-007-1",
|
||||
"task": "lookup",
|
||||
"gold": 61,
|
||||
"arms": {
|
||||
"baseline": {
|
||||
"tokens": [
|
||||
19,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "43<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 43,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,578 @@
|
||||
[
|
||||
{
|
||||
"id": "diagnostic-000-0",
|
||||
"gold": 76,
|
||||
"tokens": [
|
||||
22,
|
||||
21,
|
||||
248046
|
||||
],
|
||||
"log_probs": {
|
||||
"native": [
|
||||
-0.024837493896484375,
|
||||
-0.0002384185791015625,
|
||||
-2.6702880859375e-05
|
||||
],
|
||||
"baseline": [
|
||||
-3.1313209533691406,
|
||||
-0.6160259246826172,
|
||||
-0.0002994537353515625
|
||||
],
|
||||
"restore-15": [
|
||||
-0.32304954528808594,
|
||||
-0.000881195068359375,
|
||||
-2.47955322265625e-05
|
||||
],
|
||||
"restore-19": [
|
||||
-0.7100887298583984,
|
||||
-0.0026397705078125,
|
||||
-0.0001506805419921875
|
||||
],
|
||||
"restore-23": [
|
||||
-2.4421043395996094,
|
||||
-0.5711994171142578,
|
||||
-0.0023059844970703125
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-000-1",
|
||||
"gold": 75,
|
||||
"tokens": [
|
||||
22,
|
||||
20,
|
||||
248046
|
||||
],
|
||||
"log_probs": {
|
||||
"native": [
|
||||
-0.014467239379882812,
|
||||
-0.000675201416015625,
|
||||
-2.09808349609375e-05
|
||||
],
|
||||
"baseline": [
|
||||
-3.0086593627929688,
|
||||
-2.8373260498046875,
|
||||
-0.0002994537353515625
|
||||
],
|
||||
"restore-15": [
|
||||
-0.29117584228515625,
|
||||
-0.0007476806640625,
|
||||
-2.47955322265625e-05
|
||||
],
|
||||
"restore-19": [
|
||||
-0.6275234222412109,
|
||||
-0.022729873657226562,
|
||||
-0.000133514404296875
|
||||
],
|
||||
"restore-23": [
|
||||
-2.3499526977539062,
|
||||
-2.0442771911621094,
|
||||
-0.0018825531005859375
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-001-0",
|
||||
"gold": 39,
|
||||
"tokens": [
|
||||
18,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"log_probs": {
|
||||
"native": [
|
||||
-0.0038299560546875,
|
||||
-0.0001392364501953125,
|
||||
-7.62939453125e-06
|
||||
],
|
||||
"baseline": [
|
||||
-1.949319839477539,
|
||||
-0.018270492553710938,
|
||||
-6.67572021484375e-05
|
||||
],
|
||||
"restore-15": [
|
||||
-0.2358112335205078,
|
||||
-0.000335693359375,
|
||||
-1.52587890625e-05
|
||||
],
|
||||
"restore-19": [
|
||||
-0.10454750061035156,
|
||||
-8.58306884765625e-05,
|
||||
-4.9591064453125e-05
|
||||
],
|
||||
"restore-23": [
|
||||
-1.6455535888671875,
|
||||
-0.04067420959472656,
|
||||
-0.0001983642578125
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-001-1",
|
||||
"gold": 76,
|
||||
"tokens": [
|
||||
22,
|
||||
21,
|
||||
248046
|
||||
],
|
||||
"log_probs": {
|
||||
"native": [
|
||||
-0.0050868988037109375,
|
||||
-0.0002613067626953125,
|
||||
-7.62939453125e-06
|
||||
],
|
||||
"baseline": [
|
||||
-0.32277679443359375,
|
||||
-1.6059131622314453,
|
||||
-9.1552734375e-05
|
||||
],
|
||||
"restore-15": [
|
||||
-0.13455772399902344,
|
||||
-0.0006656646728515625,
|
||||
-2.47955322265625e-05
|
||||
],
|
||||
"restore-19": [
|
||||
-0.0066509246826171875,
|
||||
-0.0039806365966796875,
|
||||
-4.1961669921875e-05
|
||||
],
|
||||
"restore-23": [
|
||||
-0.36336517333984375,
|
||||
-1.0072898864746094,
|
||||
-0.00034332275390625
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-002-0",
|
||||
"gold": 49,
|
||||
"tokens": [
|
||||
19,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"log_probs": {
|
||||
"native": [
|
||||
-0.0087738037109375,
|
||||
-0.00025177001953125,
|
||||
-2.09808349609375e-05
|
||||
],
|
||||
"baseline": [
|
||||
-2.0372848510742188,
|
||||
-0.009572982788085938,
|
||||
-0.0003986358642578125
|
||||
],
|
||||
"restore-15": [
|
||||
-0.09753608703613281,
|
||||
-0.00032806396484375,
|
||||
-4.00543212890625e-05
|
||||
],
|
||||
"restore-19": [
|
||||
-0.2421588897705078,
|
||||
-0.00037384033203125,
|
||||
-0.0001430511474609375
|
||||
],
|
||||
"restore-23": [
|
||||
-1.860239028930664,
|
||||
-0.04126930236816406,
|
||||
-0.0017147064208984375
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-002-1",
|
||||
"gold": 22,
|
||||
"tokens": [
|
||||
17,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"log_probs": {
|
||||
"native": [
|
||||
-0.002490997314453125,
|
||||
-0.0012187957763671875,
|
||||
-1.1444091796875e-05
|
||||
],
|
||||
"baseline": [
|
||||
-3.9617557525634766,
|
||||
-0.8179492950439453,
|
||||
-0.000637054443359375
|
||||
],
|
||||
"restore-15": [
|
||||
-0.035186767578125,
|
||||
-0.027009963989257812,
|
||||
-2.47955322265625e-05
|
||||
],
|
||||
"restore-19": [
|
||||
-0.43062400817871094,
|
||||
-0.0025691986083984375,
|
||||
-0.000225067138671875
|
||||
],
|
||||
"restore-23": [
|
||||
-3.3459339141845703,
|
||||
-0.8381309509277344,
|
||||
-0.0040531158447265625
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-003-0",
|
||||
"gold": 63,
|
||||
"tokens": [
|
||||
21,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"log_probs": {
|
||||
"native": [
|
||||
-0.012937545776367188,
|
||||
-0.0007839202880859375,
|
||||
-7.62939453125e-06
|
||||
],
|
||||
"baseline": [
|
||||
-3.4249229431152344,
|
||||
-0.07147789001464844,
|
||||
-0.0001373291015625
|
||||
],
|
||||
"restore-15": [
|
||||
-0.06400489807128906,
|
||||
-0.010293960571289062,
|
||||
-7.62939453125e-06
|
||||
],
|
||||
"restore-19": [
|
||||
-0.03154754638671875,
|
||||
-0.000339508056640625,
|
||||
-0.0001220703125
|
||||
],
|
||||
"restore-23": [
|
||||
-2.2207107543945312,
|
||||
-0.12037086486816406,
|
||||
-0.0005855560302734375
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-003-1",
|
||||
"gold": 21,
|
||||
"tokens": [
|
||||
17,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"log_probs": {
|
||||
"native": [
|
||||
-0.000797271728515625,
|
||||
-0.0002193450927734375,
|
||||
-5.7220458984375e-06
|
||||
],
|
||||
"baseline": [
|
||||
-5.151775360107422,
|
||||
-1.0628166198730469,
|
||||
-0.00031280517578125
|
||||
],
|
||||
"restore-15": [
|
||||
-0.009588241577148438,
|
||||
-0.005767822265625,
|
||||
-7.62939453125e-06
|
||||
],
|
||||
"restore-19": [
|
||||
-0.06529045104980469,
|
||||
-0.0006694793701171875,
|
||||
-0.0003108978271484375
|
||||
],
|
||||
"restore-23": [
|
||||
-3.9648704528808594,
|
||||
-0.5995655059814453,
|
||||
-0.0019969940185546875
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-004-0",
|
||||
"gold": 74,
|
||||
"tokens": [
|
||||
22,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"log_probs": {
|
||||
"native": [
|
||||
-0.01715850830078125,
|
||||
-0.0021381378173828125,
|
||||
-3.814697265625e-06
|
||||
],
|
||||
"baseline": [
|
||||
-2.838041305541992,
|
||||
-0.9877510070800781,
|
||||
-4.57763671875e-05
|
||||
],
|
||||
"restore-15": [
|
||||
-1.0562248229980469,
|
||||
-0.0022220611572265625,
|
||||
-3.814697265625e-06
|
||||
],
|
||||
"restore-19": [
|
||||
-0.03605461120605469,
|
||||
-0.016172409057617188,
|
||||
-3.24249267578125e-05
|
||||
],
|
||||
"restore-23": [
|
||||
-2.322092056274414,
|
||||
-1.1123313903808594,
|
||||
-0.0003261566162109375
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-004-1",
|
||||
"gold": 29,
|
||||
"tokens": [
|
||||
17,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"log_probs": {
|
||||
"native": [
|
||||
-0.0016422271728515625,
|
||||
-0.0002899169921875,
|
||||
-3.814697265625e-06
|
||||
],
|
||||
"baseline": [
|
||||
-5.034467697143555,
|
||||
-0.5872783660888672,
|
||||
-8.20159912109375e-05
|
||||
],
|
||||
"restore-15": [
|
||||
-0.2858295440673828,
|
||||
-0.0021343231201171875,
|
||||
-3.814697265625e-06
|
||||
],
|
||||
"restore-19": [
|
||||
-0.23784446716308594,
|
||||
-0.000537872314453125,
|
||||
-4.9591064453125e-05
|
||||
],
|
||||
"restore-23": [
|
||||
-4.553504943847656,
|
||||
-0.6740207672119141,
|
||||
-0.0006809234619140625
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-005-0",
|
||||
"gold": 39,
|
||||
"tokens": [
|
||||
18,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"log_probs": {
|
||||
"native": [
|
||||
-0.013723373413085938,
|
||||
-0.00012969970703125,
|
||||
-7.62939453125e-06
|
||||
],
|
||||
"baseline": [
|
||||
-5.65399169921875,
|
||||
-0.131378173828125,
|
||||
-0.000743865966796875
|
||||
],
|
||||
"restore-15": [
|
||||
-0.9178924560546875,
|
||||
-0.000484466552734375,
|
||||
-1.71661376953125e-05
|
||||
],
|
||||
"restore-19": [
|
||||
-0.47063255310058594,
|
||||
-0.0001010894775390625,
|
||||
-0.00031280517578125
|
||||
],
|
||||
"restore-23": [
|
||||
-4.959165573120117,
|
||||
-0.28261756896972656,
|
||||
-0.0032291412353515625
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-005-1",
|
||||
"gold": 77,
|
||||
"tokens": [
|
||||
22,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"log_probs": {
|
||||
"native": [
|
||||
-0.23149681091308594,
|
||||
-0.000152587890625,
|
||||
-1.71661376953125e-05
|
||||
],
|
||||
"baseline": [
|
||||
-2.2939319610595703,
|
||||
-1.0310783386230469,
|
||||
-0.0007724761962890625
|
||||
],
|
||||
"restore-15": [
|
||||
-0.4403190612792969,
|
||||
-0.0023441314697265625,
|
||||
-3.4332275390625e-05
|
||||
],
|
||||
"restore-19": [
|
||||
-0.29297637939453125,
|
||||
-0.0004711151123046875,
|
||||
-0.0002765655517578125
|
||||
],
|
||||
"restore-23": [
|
||||
-2.098073959350586,
|
||||
-0.8647232055664062,
|
||||
-0.00260162353515625
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-006-0",
|
||||
"gold": 40,
|
||||
"tokens": [
|
||||
19,
|
||||
15,
|
||||
248046
|
||||
],
|
||||
"log_probs": {
|
||||
"native": [
|
||||
-0.014951705932617188,
|
||||
-0.0005702972412109375,
|
||||
-7.62939453125e-06
|
||||
],
|
||||
"baseline": [
|
||||
-1.4999065399169922,
|
||||
-0.39727783203125,
|
||||
-0.000370025634765625
|
||||
],
|
||||
"restore-15": [
|
||||
-0.09920883178710938,
|
||||
-0.0010547637939453125,
|
||||
-7.62939453125e-06
|
||||
],
|
||||
"restore-19": [
|
||||
-0.059215545654296875,
|
||||
-0.004215240478515625,
|
||||
-0.00017547607421875
|
||||
],
|
||||
"restore-23": [
|
||||
-1.4863815307617188,
|
||||
-0.36647796630859375,
|
||||
-0.0021572113037109375
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-006-1",
|
||||
"gold": 67,
|
||||
"tokens": [
|
||||
21,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"log_probs": {
|
||||
"native": [
|
||||
-0.144378662109375,
|
||||
-0.000316619873046875,
|
||||
-1.1444091796875e-05
|
||||
],
|
||||
"baseline": [
|
||||
-2.6766510009765625,
|
||||
-0.34818458557128906,
|
||||
-0.000194549560546875
|
||||
],
|
||||
"restore-15": [
|
||||
-0.09241104125976562,
|
||||
-0.0078125,
|
||||
-1.9073486328125e-05
|
||||
],
|
||||
"restore-19": [
|
||||
-0.1442413330078125,
|
||||
-0.00060272216796875,
|
||||
-0.0001201629638671875
|
||||
],
|
||||
"restore-23": [
|
||||
-2.3896827697753906,
|
||||
-0.3394451141357422,
|
||||
-0.001068115234375
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-007-0",
|
||||
"gold": 89,
|
||||
"tokens": [
|
||||
23,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"log_probs": {
|
||||
"native": [
|
||||
-0.012271881103515625,
|
||||
-0.000148773193359375,
|
||||
-2.6702880859375e-05
|
||||
],
|
||||
"baseline": [
|
||||
-4.154172897338867,
|
||||
-0.5092639923095703,
|
||||
-0.000244140625
|
||||
],
|
||||
"restore-15": [
|
||||
-0.28399085998535156,
|
||||
-0.000385284423828125,
|
||||
-2.47955322265625e-05
|
||||
],
|
||||
"restore-19": [
|
||||
-0.17025375366210938,
|
||||
-0.0014133453369140625,
|
||||
-0.0001506805419921875
|
||||
],
|
||||
"restore-23": [
|
||||
-3.85772705078125,
|
||||
-0.6171798706054688,
|
||||
-0.00144195556640625
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-007-1",
|
||||
"gold": 61,
|
||||
"tokens": [
|
||||
21,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"log_probs": {
|
||||
"native": [
|
||||
-0.03597068786621094,
|
||||
-0.0006103515625,
|
||||
-4.00543212890625e-05
|
||||
],
|
||||
"baseline": [
|
||||
-4.429452896118164,
|
||||
-0.06722450256347656,
|
||||
-0.000396728515625
|
||||
],
|
||||
"restore-15": [
|
||||
-0.4400196075439453,
|
||||
-0.0048809051513671875,
|
||||
-5.340576171875e-05
|
||||
],
|
||||
"restore-19": [
|
||||
-0.7014026641845703,
|
||||
-0.0012664794921875,
|
||||
-0.0002269744873046875
|
||||
],
|
||||
"restore-23": [
|
||||
-3.604585647583008,
|
||||
-0.2347412109375,
|
||||
-0.001617431640625
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"questions": 16,
|
||||
"scores_per_condition": 48,
|
||||
"mean_values": {
|
||||
"native": {
|
||||
"mean_gold_sequence_nll": 0.034574151039123535,
|
||||
"mean_gold_probability_by_position": [
|
||||
0.9682242448620498,
|
||||
0.9994912364442534,
|
||||
0.9999858142451772
|
||||
],
|
||||
"higher_gold_sequence_probability_than_baseline": 16
|
||||
},
|
||||
"baseline": {
|
||||
"mean_gold_sequence_nll": 3.9170196056365967,
|
||||
"mean_gold_probability_by_position": [
|
||||
0.10226646583984653,
|
||||
0.5978359563033113,
|
||||
0.9996817869409924
|
||||
],
|
||||
"higher_gold_sequence_probability_than_baseline": 0,
|
||||
"greedy_correct": 0
|
||||
},
|
||||
"restore-15": {
|
||||
"mean_gold_sequence_nll": 0.3046555519104004,
|
||||
"mean_gold_probability_by_position": [
|
||||
0.7682960002805064,
|
||||
0.9958208747441234,
|
||||
0.999979138680711
|
||||
],
|
||||
"higher_gold_sequence_probability_than_baseline": 16,
|
||||
"greedy_correct": 15
|
||||
},
|
||||
"restore-19": {
|
||||
"mean_gold_sequence_nll": 0.27448391914367676,
|
||||
"mean_gold_probability_by_position": [
|
||||
0.7832170789007052,
|
||||
0.9963902623442181,
|
||||
0.9998424217156324
|
||||
],
|
||||
"higher_gold_sequence_probability_than_baseline": 16,
|
||||
"greedy_correct": 16
|
||||
},
|
||||
"restore-23": {
|
||||
"mean_gold_sequence_nll": 3.3277788162231445,
|
||||
"mean_gold_probability_by_position": [
|
||||
0.12458921584706335,
|
||||
0.5997749958188688,
|
||||
0.9983642064347934
|
||||
],
|
||||
"higher_gold_sequence_probability_than_baseline": 16,
|
||||
"greedy_correct": 1
|
||||
}
|
||||
},
|
||||
"majority_gold_tokens_on_matching_generated_prefix": {
|
||||
"baseline": 1,
|
||||
"restore-15": 44,
|
||||
"restore-19": 46,
|
||||
"restore-23": 2
|
||||
},
|
||||
"majority_token_disagreements": [],
|
||||
"sha256": {
|
||||
"protocol.json": "6858dbc64db0b989e8112e9dbea70662a2a05f66f11b180e8f2c668c74c43aef",
|
||||
"tokenizer.json": "5f9e4d4901a92b997e463c1f46055088b6cca5ca61a6522d1b9f64c4bb81cb42",
|
||||
"diagnostic-gold-log-probs.json": "7fb33eca323ab3ec45ceae8be77609e388fe88b2b77eb59c43726cc0c39b69e3",
|
||||
"baseline.json": "8f3fb8773fa790de01604db9a313365bab25a55c86b363eaf0269f94df020e8f",
|
||||
"restore-15.json": "53b2af36d1f5d5e960d1f7b22630f8f72d7e9a2016131747c48d7e5c17ef7fcb",
|
||||
"restore-19.json": "c1b158e61eaa98b1c24ead81363ef3193b392d36947f3199e7930fe199e5163a",
|
||||
"restore-23.json": "4513c537d5d957c1bfbe0e23741dad3d77cc76a08e7ff255e38661e9e7b58c8d"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,290 @@
|
||||
[
|
||||
{
|
||||
"id": "diagnostic-000-0",
|
||||
"task": "lookup",
|
||||
"gold": 76,
|
||||
"arms": {
|
||||
"restore-15": {
|
||||
"tokens": [
|
||||
22,
|
||||
21,
|
||||
248046
|
||||
],
|
||||
"response": "76<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 76,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-000-1",
|
||||
"task": "lookup",
|
||||
"gold": 75,
|
||||
"arms": {
|
||||
"restore-15": {
|
||||
"tokens": [
|
||||
22,
|
||||
20,
|
||||
248046
|
||||
],
|
||||
"response": "75<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 75,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-001-0",
|
||||
"task": "lookup",
|
||||
"gold": 39,
|
||||
"arms": {
|
||||
"restore-15": {
|
||||
"tokens": [
|
||||
18,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "39<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 39,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-001-1",
|
||||
"task": "lookup",
|
||||
"gold": 76,
|
||||
"arms": {
|
||||
"restore-15": {
|
||||
"tokens": [
|
||||
22,
|
||||
21,
|
||||
248046
|
||||
],
|
||||
"response": "76<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 76,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-002-0",
|
||||
"task": "lookup",
|
||||
"gold": 49,
|
||||
"arms": {
|
||||
"restore-15": {
|
||||
"tokens": [
|
||||
19,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "49<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 49,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-002-1",
|
||||
"task": "lookup",
|
||||
"gold": 22,
|
||||
"arms": {
|
||||
"restore-15": {
|
||||
"tokens": [
|
||||
17,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "22<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 22,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-003-0",
|
||||
"task": "lookup",
|
||||
"gold": 63,
|
||||
"arms": {
|
||||
"restore-15": {
|
||||
"tokens": [
|
||||
21,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "63<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 63,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-003-1",
|
||||
"task": "lookup",
|
||||
"gold": 21,
|
||||
"arms": {
|
||||
"restore-15": {
|
||||
"tokens": [
|
||||
17,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "21<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 21,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-004-0",
|
||||
"task": "lookup",
|
||||
"gold": 74,
|
||||
"arms": {
|
||||
"restore-15": {
|
||||
"tokens": [
|
||||
22,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"response": "74<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 74,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-004-1",
|
||||
"task": "lookup",
|
||||
"gold": 29,
|
||||
"arms": {
|
||||
"restore-15": {
|
||||
"tokens": [
|
||||
17,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "29<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 29,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-005-0",
|
||||
"task": "lookup",
|
||||
"gold": 39,
|
||||
"arms": {
|
||||
"restore-15": {
|
||||
"tokens": [
|
||||
24,
|
||||
23,
|
||||
248046
|
||||
],
|
||||
"response": "98<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 98,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-005-1",
|
||||
"task": "lookup",
|
||||
"gold": 77,
|
||||
"arms": {
|
||||
"restore-15": {
|
||||
"tokens": [
|
||||
22,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "77<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 77,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-006-0",
|
||||
"task": "lookup",
|
||||
"gold": 40,
|
||||
"arms": {
|
||||
"restore-15": {
|
||||
"tokens": [
|
||||
19,
|
||||
15,
|
||||
248046
|
||||
],
|
||||
"response": "40<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 40,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-006-1",
|
||||
"task": "lookup",
|
||||
"gold": 67,
|
||||
"arms": {
|
||||
"restore-15": {
|
||||
"tokens": [
|
||||
21,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "67<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 67,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-007-0",
|
||||
"task": "lookup",
|
||||
"gold": 89,
|
||||
"arms": {
|
||||
"restore-15": {
|
||||
"tokens": [
|
||||
23,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "89<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 89,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-007-1",
|
||||
"task": "lookup",
|
||||
"gold": 61,
|
||||
"arms": {
|
||||
"restore-15": {
|
||||
"tokens": [
|
||||
21,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "61<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 61,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,290 @@
|
||||
[
|
||||
{
|
||||
"id": "diagnostic-000-0",
|
||||
"task": "lookup",
|
||||
"gold": 76,
|
||||
"arms": {
|
||||
"restore-19": {
|
||||
"tokens": [
|
||||
22,
|
||||
21,
|
||||
248046
|
||||
],
|
||||
"response": "76<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 76,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-000-1",
|
||||
"task": "lookup",
|
||||
"gold": 75,
|
||||
"arms": {
|
||||
"restore-19": {
|
||||
"tokens": [
|
||||
22,
|
||||
20,
|
||||
248046
|
||||
],
|
||||
"response": "75<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 75,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-001-0",
|
||||
"task": "lookup",
|
||||
"gold": 39,
|
||||
"arms": {
|
||||
"restore-19": {
|
||||
"tokens": [
|
||||
18,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "39<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 39,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-001-1",
|
||||
"task": "lookup",
|
||||
"gold": 76,
|
||||
"arms": {
|
||||
"restore-19": {
|
||||
"tokens": [
|
||||
22,
|
||||
21,
|
||||
248046
|
||||
],
|
||||
"response": "76<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 76,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-002-0",
|
||||
"task": "lookup",
|
||||
"gold": 49,
|
||||
"arms": {
|
||||
"restore-19": {
|
||||
"tokens": [
|
||||
19,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "49<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 49,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-002-1",
|
||||
"task": "lookup",
|
||||
"gold": 22,
|
||||
"arms": {
|
||||
"restore-19": {
|
||||
"tokens": [
|
||||
17,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "22<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 22,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-003-0",
|
||||
"task": "lookup",
|
||||
"gold": 63,
|
||||
"arms": {
|
||||
"restore-19": {
|
||||
"tokens": [
|
||||
21,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "63<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 63,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-003-1",
|
||||
"task": "lookup",
|
||||
"gold": 21,
|
||||
"arms": {
|
||||
"restore-19": {
|
||||
"tokens": [
|
||||
17,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "21<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 21,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-004-0",
|
||||
"task": "lookup",
|
||||
"gold": 74,
|
||||
"arms": {
|
||||
"restore-19": {
|
||||
"tokens": [
|
||||
22,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"response": "74<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 74,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-004-1",
|
||||
"task": "lookup",
|
||||
"gold": 29,
|
||||
"arms": {
|
||||
"restore-19": {
|
||||
"tokens": [
|
||||
17,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "29<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 29,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-005-0",
|
||||
"task": "lookup",
|
||||
"gold": 39,
|
||||
"arms": {
|
||||
"restore-19": {
|
||||
"tokens": [
|
||||
18,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "39<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 39,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-005-1",
|
||||
"task": "lookup",
|
||||
"gold": 77,
|
||||
"arms": {
|
||||
"restore-19": {
|
||||
"tokens": [
|
||||
22,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "77<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 77,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-006-0",
|
||||
"task": "lookup",
|
||||
"gold": 40,
|
||||
"arms": {
|
||||
"restore-19": {
|
||||
"tokens": [
|
||||
19,
|
||||
15,
|
||||
248046
|
||||
],
|
||||
"response": "40<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 40,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-006-1",
|
||||
"task": "lookup",
|
||||
"gold": 67,
|
||||
"arms": {
|
||||
"restore-19": {
|
||||
"tokens": [
|
||||
21,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "67<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 67,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-007-0",
|
||||
"task": "lookup",
|
||||
"gold": 89,
|
||||
"arms": {
|
||||
"restore-19": {
|
||||
"tokens": [
|
||||
23,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "89<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 89,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-007-1",
|
||||
"task": "lookup",
|
||||
"gold": 61,
|
||||
"arms": {
|
||||
"restore-19": {
|
||||
"tokens": [
|
||||
21,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "61<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 61,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,290 @@
|
||||
[
|
||||
{
|
||||
"id": "diagnostic-000-0",
|
||||
"task": "lookup",
|
||||
"gold": 76,
|
||||
"arms": {
|
||||
"restore-23": {
|
||||
"tokens": [
|
||||
24,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"response": "94<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 94,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-000-1",
|
||||
"task": "lookup",
|
||||
"gold": 75,
|
||||
"arms": {
|
||||
"restore-23": {
|
||||
"tokens": [
|
||||
24,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"response": "94<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 94,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-001-0",
|
||||
"task": "lookup",
|
||||
"gold": 39,
|
||||
"arms": {
|
||||
"restore-23": {
|
||||
"tokens": [
|
||||
22,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "73<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 73,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-001-1",
|
||||
"task": "lookup",
|
||||
"gold": 76,
|
||||
"arms": {
|
||||
"restore-23": {
|
||||
"tokens": [
|
||||
22,
|
||||
21,
|
||||
248046
|
||||
],
|
||||
"response": "76<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 76,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-002-0",
|
||||
"task": "lookup",
|
||||
"gold": 49,
|
||||
"arms": {
|
||||
"restore-23": {
|
||||
"tokens": [
|
||||
20,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "52<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 52,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-002-1",
|
||||
"task": "lookup",
|
||||
"gold": 22,
|
||||
"arms": {
|
||||
"restore-23": {
|
||||
"tokens": [
|
||||
20,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "52<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 52,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-003-0",
|
||||
"task": "lookup",
|
||||
"gold": 63,
|
||||
"arms": {
|
||||
"restore-23": {
|
||||
"tokens": [
|
||||
24,
|
||||
15,
|
||||
248046
|
||||
],
|
||||
"response": "90<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 90,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-003-1",
|
||||
"task": "lookup",
|
||||
"gold": 21,
|
||||
"arms": {
|
||||
"restore-23": {
|
||||
"tokens": [
|
||||
24,
|
||||
15,
|
||||
248046
|
||||
],
|
||||
"response": "90<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 90,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-004-0",
|
||||
"task": "lookup",
|
||||
"gold": 74,
|
||||
"arms": {
|
||||
"restore-23": {
|
||||
"tokens": [
|
||||
24,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "99<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 99,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-004-1",
|
||||
"task": "lookup",
|
||||
"gold": 29,
|
||||
"arms": {
|
||||
"restore-23": {
|
||||
"tokens": [
|
||||
24,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "99<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 99,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-005-0",
|
||||
"task": "lookup",
|
||||
"gold": 39,
|
||||
"arms": {
|
||||
"restore-23": {
|
||||
"tokens": [
|
||||
21,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "61<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 61,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-005-1",
|
||||
"task": "lookup",
|
||||
"gold": 77,
|
||||
"arms": {
|
||||
"restore-23": {
|
||||
"tokens": [
|
||||
21,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "67<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 67,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-006-0",
|
||||
"task": "lookup",
|
||||
"gold": 40,
|
||||
"arms": {
|
||||
"restore-23": {
|
||||
"tokens": [
|
||||
20,
|
||||
15,
|
||||
248046
|
||||
],
|
||||
"response": "50<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 50,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-006-1",
|
||||
"task": "lookup",
|
||||
"gold": 67,
|
||||
"arms": {
|
||||
"restore-23": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-007-0",
|
||||
"task": "lookup",
|
||||
"gold": 89,
|
||||
"arms": {
|
||||
"restore-23": {
|
||||
"tokens": [
|
||||
19,
|
||||
21,
|
||||
248046
|
||||
],
|
||||
"response": "46<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 46,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-007-1",
|
||||
"task": "lookup",
|
||||
"gold": 61,
|
||||
"arms": {
|
||||
"restore-23": {
|
||||
"tokens": [
|
||||
19,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "43<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 43,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,95 @@
|
||||
{
|
||||
"protocol_sha256": "6858dbc64db0b989e8112e9dbea70662a2a05f66f11b180e8f2c668c74c43aef",
|
||||
"tokenizer_sha256": "5f9e4d4901a92b997e463c1f46055088b6cca5ca61a6522d1b9f64c4bb81cb42",
|
||||
"baseline_adapter_sha256": "c82db5af7fa42cf58a349f3e53961da2360b211a7ed606f53a728860c64f6f29",
|
||||
"answer_file_sha256": {
|
||||
"baseline.json": "8f3fb8773fa790de01604db9a313365bab25a55c86b363eaf0269f94df020e8f",
|
||||
"restore-15.json": "53b2af36d1f5d5e960d1f7b22630f8f72d7e9a2016131747c48d7e5c17ef7fcb",
|
||||
"restore-19.json": "c1b158e61eaa98b1c24ead81363ef3193b392d36947f3199e7930fe199e5163a",
|
||||
"restore-23.json": "4513c537d5d957c1bfbe0e23741dad3d77cc76a08e7ff255e38661e9e7b58c8d"
|
||||
},
|
||||
"questions": 16,
|
||||
"pairs": 8,
|
||||
"scores": {
|
||||
"baseline": {
|
||||
"correct": 0,
|
||||
"both_correct_pairs": 0,
|
||||
"complete_integer_answers": 16,
|
||||
"wrong_ids": [
|
||||
"diagnostic-000-0",
|
||||
"diagnostic-000-1",
|
||||
"diagnostic-001-0",
|
||||
"diagnostic-001-1",
|
||||
"diagnostic-002-0",
|
||||
"diagnostic-002-1",
|
||||
"diagnostic-003-0",
|
||||
"diagnostic-003-1",
|
||||
"diagnostic-004-0",
|
||||
"diagnostic-004-1",
|
||||
"diagnostic-005-0",
|
||||
"diagnostic-005-1",
|
||||
"diagnostic-006-0",
|
||||
"diagnostic-006-1",
|
||||
"diagnostic-007-0",
|
||||
"diagnostic-007-1"
|
||||
]
|
||||
},
|
||||
"restore-15": {
|
||||
"correct": 15,
|
||||
"both_correct_pairs": 7,
|
||||
"complete_integer_answers": 16,
|
||||
"wrong_ids": [
|
||||
"diagnostic-005-0"
|
||||
]
|
||||
},
|
||||
"restore-19": {
|
||||
"correct": 16,
|
||||
"both_correct_pairs": 8,
|
||||
"complete_integer_answers": 16,
|
||||
"wrong_ids": []
|
||||
},
|
||||
"restore-23": {
|
||||
"correct": 1,
|
||||
"both_correct_pairs": 0,
|
||||
"complete_integer_answers": 16,
|
||||
"wrong_ids": [
|
||||
"diagnostic-000-0",
|
||||
"diagnostic-000-1",
|
||||
"diagnostic-001-0",
|
||||
"diagnostic-002-0",
|
||||
"diagnostic-002-1",
|
||||
"diagnostic-003-0",
|
||||
"diagnostic-003-1",
|
||||
"diagnostic-004-0",
|
||||
"diagnostic-004-1",
|
||||
"diagnostic-005-0",
|
||||
"diagnostic-005-1",
|
||||
"diagnostic-006-0",
|
||||
"diagnostic-006-1",
|
||||
"diagnostic-007-0",
|
||||
"diagnostic-007-1"
|
||||
]
|
||||
}
|
||||
},
|
||||
"ranks_by_layer": {
|
||||
"allocated": {
|
||||
"19": 48,
|
||||
"15": 40,
|
||||
"23": 32
|
||||
},
|
||||
"reversed": {
|
||||
"19": 32,
|
||||
"15": 40,
|
||||
"23": 48
|
||||
},
|
||||
"uniform": {
|
||||
"15": 40,
|
||||
"19": 40,
|
||||
"23": 40
|
||||
}
|
||||
},
|
||||
"rank_order_after_omitting_one_pair": {
|
||||
"19,15,23": 7,
|
||||
"15,19,23": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
024720e9eae7556e4d5ca2ca1d71dd544815c79ed2c51b113564d5a6fb4ad004 crossqkv/lisa_combination_screen.py
|
||||
663d4dad556f08b69521543e73d67362d46dc694c747e72b6cb786da7484e090 crossqkv/lisa_rank_compare.py
|
||||
f212bd1b17b38d995060fc04b20a77b4e572cffc9b3776dc16ef7cf012ee89a3 crossqkv/lisa_trajectory_train.py
|
||||
e03e7edf719026ffd99bfc99a539ee22c71884baa5cdaf629d8f4e44e1565c41 crossqkv/lisa_combination_eval.py
|
||||
519e0a031efcfb69c9b86fca1cb649fe8bb93d799401c8023ff7b6549cded448 crossqkv/lisa_full_answer.py
|
||||
1a1a4cbc8e3c5b97accfe2d0ba18a21c9e2ebfa25d66561d7ef9c59668049efa crossqkv/lisa_full_answer_train.py
|
||||
57e73f1e30c8db8daec7b13d6455af2822b2db3e600531f8a60e2381d093ad91 crossqkv/lisa_full_answer_verify.py
|
||||
98927a1ccd935b2f7a438bad31bbd973e210a54deceac911c61551092e52c96c crossqkv/lisa_generate.py
|
||||
d47b4c9cc34082e9b356e745821298a43981e4cd18ed55a3f59b4b6fe7cc46e3 crossqkv/lisa_tail.py
|
||||
9f0b6a53f107950661e91c16f03b49440708b3936120e2f84ef1d66f185257b6 crossqkv/lisa_train.py
|
||||
94437e0138c54ec34b1beaaa0e08a334ce0822f60af598a5a896459b778a3a1c functional/model.py
|
||||
e5953ed7e4cc58c49290bf768c173828ce1c29f36795f5c657ed0f1d76f0a371 tests/test_lisa_combinations.py
|
||||
e1d70b10863dab1e13dfa9573c0d87fc6ca017039c3cf9b90f7628f3e7fe5664 crossqkv/lisa_effect_answer_audit.py
|
||||
@@ -0,0 +1,679 @@
|
||||
{
|
||||
"source_receipt_sha256": "682bc035a5bed9f9245f589cacf3e9616300e8bf5e85d3743b1264a56360fa55",
|
||||
"split": "fit",
|
||||
"sites": [
|
||||
15,
|
||||
19,
|
||||
23
|
||||
],
|
||||
"native_donor_layers": [
|
||||
11,
|
||||
15,
|
||||
19
|
||||
],
|
||||
"donor_fit": "affine, opposite index parity",
|
||||
"metric": "mean per-example, per-layer, per-head, all token-pair squared raw score residual",
|
||||
"mean_mse": {
|
||||
"15": {
|
||||
"0": 3.0491509033035786,
|
||||
"32": 0.039521781594895264,
|
||||
"40": 0.020783290371489457,
|
||||
"48": 0.010840281262399451
|
||||
},
|
||||
"19": {
|
||||
"0": 2.512677766820607,
|
||||
"32": 0.028017079240270398,
|
||||
"40": 0.014575690475241961,
|
||||
"48": 0.0075188286924900765
|
||||
},
|
||||
"23": {
|
||||
"0": 2.32949672919509,
|
||||
"32": 0.028727581321570477,
|
||||
"40": 0.015100597622509863,
|
||||
"48": 0.007748733860780121
|
||||
}
|
||||
},
|
||||
"configurations": [
|
||||
{
|
||||
"ranks": [
|
||||
40,
|
||||
40,
|
||||
40
|
||||
],
|
||||
"mean_mse": 0.016819859489747093,
|
||||
"examples_below_uniform_mse": 0
|
||||
},
|
||||
{
|
||||
"ranks": [
|
||||
32,
|
||||
40,
|
||||
48
|
||||
],
|
||||
"mean_mse": 0.02061540197697245,
|
||||
"examples_below_uniform_mse": 0
|
||||
},
|
||||
{
|
||||
"ranks": [
|
||||
32,
|
||||
48,
|
||||
40
|
||||
],
|
||||
"mean_mse": 0.020713735969965067,
|
||||
"examples_below_uniform_mse": 0
|
||||
},
|
||||
{
|
||||
"ranks": [
|
||||
40,
|
||||
32,
|
||||
48
|
||||
],
|
||||
"mean_mse": 0.018849701157513325,
|
||||
"examples_below_uniform_mse": 0
|
||||
},
|
||||
{
|
||||
"ranks": [
|
||||
40,
|
||||
48,
|
||||
32
|
||||
],
|
||||
"mean_mse": 0.019009900128516666,
|
||||
"examples_below_uniform_mse": 0
|
||||
},
|
||||
{
|
||||
"ranks": [
|
||||
48,
|
||||
32,
|
||||
40
|
||||
],
|
||||
"mean_mse": 0.017985986041726573,
|
||||
"examples_below_uniform_mse": 0
|
||||
},
|
||||
{
|
||||
"ranks": [
|
||||
48,
|
||||
40,
|
||||
32
|
||||
],
|
||||
"mean_mse": 0.018047851019737295,
|
||||
"examples_below_uniform_mse": 0
|
||||
}
|
||||
],
|
||||
"examples": [
|
||||
{
|
||||
"id": "fit-lookup-000",
|
||||
"length": 105,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.088659967440397,
|
||||
"32": 0.04236259250553502,
|
||||
"40": 0.022141397788788392,
|
||||
"48": 0.011514037850336353
|
||||
},
|
||||
"19": {
|
||||
"0": 2.60677435406026,
|
||||
"32": 0.030297211627820866,
|
||||
"40": 0.01598283395379536,
|
||||
"48": 0.008219940043388664
|
||||
},
|
||||
"23": {
|
||||
"0": 2.3563735679615907,
|
||||
"32": 0.02892025119959655,
|
||||
"40": 0.015145857942858488,
|
||||
"48": 0.007854447730351124
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-001",
|
||||
"length": 106,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.0437552842711924,
|
||||
"32": 0.041460379107627,
|
||||
"40": 0.02197332831278948,
|
||||
"48": 0.01154738790723923
|
||||
},
|
||||
"19": {
|
||||
"0": 2.6002811453342303,
|
||||
"32": 0.029788866923491097,
|
||||
"40": 0.015212847384373162,
|
||||
"48": 0.007800509698369113
|
||||
},
|
||||
"23": {
|
||||
"0": 2.3453950294400725,
|
||||
"32": 0.028961945449738232,
|
||||
"40": 0.015314327377369019,
|
||||
"48": 0.007819546227552078
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-002",
|
||||
"length": 103,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.1611634458593403,
|
||||
"32": 0.039321211199099995,
|
||||
"40": 0.020199787980594405,
|
||||
"48": 0.010459417590053765
|
||||
},
|
||||
"19": {
|
||||
"0": 2.4157809408598623,
|
||||
"32": 0.02655148904575669,
|
||||
"40": 0.013735592399044141,
|
||||
"48": 0.007057144763423892
|
||||
},
|
||||
"23": {
|
||||
"0": 2.325402166282838,
|
||||
"32": 0.027055553748214518,
|
||||
"40": 0.013891678650954479,
|
||||
"48": 0.006962328419010828
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-003",
|
||||
"length": 106,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.040995331406837,
|
||||
"32": 0.03762918598377188,
|
||||
"40": 0.01984353470077239,
|
||||
"48": 0.010574553412406797
|
||||
},
|
||||
"19": {
|
||||
"0": 2.3597098591507217,
|
||||
"32": 0.02773534955136491,
|
||||
"40": 0.014466135600102365,
|
||||
"48": 0.0074571195122997225
|
||||
},
|
||||
"23": {
|
||||
"0": 2.3234745384230875,
|
||||
"32": 0.029123405193316097,
|
||||
"40": 0.015470646972640318,
|
||||
"48": 0.008016444188761525
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-004",
|
||||
"length": 106,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.0215199092782723,
|
||||
"32": 0.040987579290442236,
|
||||
"40": 0.02187090698894471,
|
||||
"48": 0.011580689428509917
|
||||
},
|
||||
"19": {
|
||||
"0": 2.573071094425272,
|
||||
"32": 0.02882784504735971,
|
||||
"40": 0.015108305637581228,
|
||||
"48": 0.007925058462351522
|
||||
},
|
||||
"23": {
|
||||
"0": 2.340310773344382,
|
||||
"32": 0.028890642640557497,
|
||||
"40": 0.015253046125958373,
|
||||
"48": 0.007854863994071565
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-005",
|
||||
"length": 106,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.0330234103086564,
|
||||
"32": 0.040488127570967286,
|
||||
"40": 0.021191326763191246,
|
||||
"48": 0.011073238036764401
|
||||
},
|
||||
"19": {
|
||||
"0": 2.454760989612247,
|
||||
"32": 0.02946771758936749,
|
||||
"40": 0.01545794859144716,
|
||||
"48": 0.00802543841461683
|
||||
},
|
||||
"23": {
|
||||
"0": 2.2967207477889273,
|
||||
"32": 0.029778415586498647,
|
||||
"40": 0.01600304961677946,
|
||||
"48": 0.0083111870016772
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-006",
|
||||
"length": 106,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.013331118405758,
|
||||
"32": 0.04131749410468123,
|
||||
"40": 0.022042406028810038,
|
||||
"48": 0.011636497469555758
|
||||
},
|
||||
"19": {
|
||||
"0": 2.528745937676687,
|
||||
"32": 0.02826800264634013,
|
||||
"40": 0.014733505683104612,
|
||||
"48": 0.0076718514475501865
|
||||
},
|
||||
"23": {
|
||||
"0": 2.3072629450831816,
|
||||
"32": 0.0289161816884407,
|
||||
"40": 0.015426171607648538,
|
||||
"48": 0.008021220293678933
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-007",
|
||||
"length": 106,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 2.9797496554592016,
|
||||
"32": 0.04008678098041669,
|
||||
"40": 0.021471205229520018,
|
||||
"48": 0.011298897793875518
|
||||
},
|
||||
"19": {
|
||||
"0": 2.524372130523825,
|
||||
"32": 0.02903602273670119,
|
||||
"40": 0.015166059667194653,
|
||||
"48": 0.007834174908611297
|
||||
},
|
||||
"23": {
|
||||
"0": 2.3610797089906277,
|
||||
"32": 0.029450602936166363,
|
||||
"40": 0.015499606337721955,
|
||||
"48": 0.00805269819015974
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-008",
|
||||
"length": 106,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.019527986904939,
|
||||
"32": 0.040274185385297874,
|
||||
"40": 0.021116286802696557,
|
||||
"48": 0.010885256441784055
|
||||
},
|
||||
"19": {
|
||||
"0": 2.523656269236793,
|
||||
"32": 0.02772895841962885,
|
||||
"40": 0.014412311378240944,
|
||||
"48": 0.007384325810057883
|
||||
},
|
||||
"23": {
|
||||
"0": 2.320639636723277,
|
||||
"32": 0.027954408126430304,
|
||||
"40": 0.014598363754756497,
|
||||
"48": 0.007555480787878869
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-009",
|
||||
"length": 105,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.1093965867603957,
|
||||
"32": 0.03755905434822006,
|
||||
"40": 0.019840372604972834,
|
||||
"48": 0.010344465475210821
|
||||
},
|
||||
"19": {
|
||||
"0": 2.505387553072129,
|
||||
"32": 0.027001747506091436,
|
||||
"40": 0.013899598887412037,
|
||||
"48": 0.007008295926413987
|
||||
},
|
||||
"23": {
|
||||
"0": 2.3448651884655374,
|
||||
"32": 0.029100983555730472,
|
||||
"40": 0.015379827992887235,
|
||||
"48": 0.007858481884474376
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-010",
|
||||
"length": 107,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.0311224516019064,
|
||||
"32": 0.04091108401342763,
|
||||
"40": 0.02180213747578483,
|
||||
"48": 0.011590187257245059
|
||||
},
|
||||
"19": {
|
||||
"0": 2.5713354258542362,
|
||||
"32": 0.029039653431551533,
|
||||
"40": 0.01531556329140523,
|
||||
"48": 0.007899517545272823
|
||||
},
|
||||
"23": {
|
||||
"0": 2.3511743607212607,
|
||||
"32": 0.03012251758846437,
|
||||
"40": 0.016076320232085935,
|
||||
"48": 0.008327212573692013
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-011",
|
||||
"length": 106,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 2.978140786774899,
|
||||
"32": 0.03878118161674924,
|
||||
"40": 0.020375268025433116,
|
||||
"48": 0.01067361843154627
|
||||
},
|
||||
"19": {
|
||||
"0": 2.545974192767094,
|
||||
"32": 0.02905582052089718,
|
||||
"40": 0.01503920798962135,
|
||||
"48": 0.007825902631264234
|
||||
},
|
||||
"23": {
|
||||
"0": 2.3154443153866144,
|
||||
"32": 0.029736139916476785,
|
||||
"40": 0.015719287229754325,
|
||||
"48": 0.00816518344542446
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-012",
|
||||
"length": 107,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.0087156260860324,
|
||||
"32": 0.039908258905094224,
|
||||
"40": 0.020951748129681164,
|
||||
"48": 0.0109459493750372
|
||||
},
|
||||
"19": {
|
||||
"0": 2.5004236680399994,
|
||||
"32": 0.027530296227075,
|
||||
"40": 0.014297426111298323,
|
||||
"48": 0.0073502099933688055
|
||||
},
|
||||
"23": {
|
||||
"0": 2.3037441781455907,
|
||||
"32": 0.028300959976612527,
|
||||
"40": 0.014905029499610128,
|
||||
"48": 0.0076801742973075585
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-013",
|
||||
"length": 105,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.090885110032237,
|
||||
"32": 0.037628764689048785,
|
||||
"40": 0.01983888726146963,
|
||||
"48": 0.010323019538322292
|
||||
},
|
||||
"19": {
|
||||
"0": 2.4559173768588263,
|
||||
"32": 0.027772754396836425,
|
||||
"40": 0.014524390215698612,
|
||||
"48": 0.007483559779230743
|
||||
},
|
||||
"23": {
|
||||
"0": 2.287404497389505,
|
||||
"32": 0.02819735934494258,
|
||||
"40": 0.014912927963379,
|
||||
"48": 0.007726565200995596
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-014",
|
||||
"length": 105,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.13819959885641,
|
||||
"32": 0.039420418861715725,
|
||||
"40": 0.020868132899275662,
|
||||
"48": 0.010854347550869874
|
||||
},
|
||||
"19": {
|
||||
"0": 2.5679901885805516,
|
||||
"32": 0.028098421308328406,
|
||||
"40": 0.014312423513410482,
|
||||
"48": 0.00732004539511427
|
||||
},
|
||||
"23": {
|
||||
"0": 2.3466282966243877,
|
||||
"32": 0.02880736726984329,
|
||||
"40": 0.014808088738714507,
|
||||
"48": 0.00750811978348572
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-015",
|
||||
"length": 104,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.0692672104629573,
|
||||
"32": 0.037746196997427546,
|
||||
"40": 0.019899233229636805,
|
||||
"48": 0.01029592139206912
|
||||
},
|
||||
"19": {
|
||||
"0": 2.4838282610330245,
|
||||
"32": 0.026826048708958952,
|
||||
"40": 0.013808543684409204,
|
||||
"48": 0.006989747600969923
|
||||
},
|
||||
"23": {
|
||||
"0": 2.322057578321556,
|
||||
"32": 0.02797636928934322,
|
||||
"40": 0.014399908661816594,
|
||||
"48": 0.007212087854706693
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-016",
|
||||
"length": 106,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.0007538969450036,
|
||||
"32": 0.03916077842933745,
|
||||
"40": 0.020493545446600054,
|
||||
"48": 0.010682154227783146
|
||||
},
|
||||
"19": {
|
||||
"0": 2.5872858743785674,
|
||||
"32": 0.028776526081457792,
|
||||
"40": 0.015233754140328008,
|
||||
"48": 0.007916572897216386
|
||||
},
|
||||
"23": {
|
||||
"0": 2.347073684588352,
|
||||
"32": 0.029756068268149995,
|
||||
"40": 0.015805893856473047,
|
||||
"48": 0.00809506288386048
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-017",
|
||||
"length": 104,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.097493153149071,
|
||||
"32": 0.03850921447926972,
|
||||
"40": 0.019769321682123874,
|
||||
"48": 0.010122230466840895
|
||||
},
|
||||
"19": {
|
||||
"0": 2.4503922223577725,
|
||||
"32": 0.025405658587984905,
|
||||
"40": 0.013039908579401138,
|
||||
"48": 0.006659946143533161
|
||||
},
|
||||
"23": {
|
||||
"0": 2.3199401227863863,
|
||||
"32": 0.02735269039309821,
|
||||
"40": 0.014341351722532756,
|
||||
"48": 0.007256346435349317
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-018",
|
||||
"length": 108,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.0013828310609036,
|
||||
"32": 0.03971017933680606,
|
||||
"40": 0.02104882562580656,
|
||||
"48": 0.011115656621268687
|
||||
},
|
||||
"19": {
|
||||
"0": 2.5217980667349007,
|
||||
"32": 0.030615218969447338,
|
||||
"40": 0.01612161718714934,
|
||||
"48": 0.008545605297330143
|
||||
},
|
||||
"23": {
|
||||
"0": 2.326397701784687,
|
||||
"32": 0.03073856758564035,
|
||||
"40": 0.016339969467014808,
|
||||
"48": 0.008568277707684677
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-019",
|
||||
"length": 103,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.0112006462653227,
|
||||
"32": 0.03764011794064314,
|
||||
"40": 0.019441597324216794,
|
||||
"48": 0.009988085038926689
|
||||
},
|
||||
"19": {
|
||||
"0": 2.543471885532161,
|
||||
"32": 0.02619589976045457,
|
||||
"40": 0.013660075369000754,
|
||||
"48": 0.007015486171297309
|
||||
},
|
||||
"23": {
|
||||
"0": 2.3365870614142663,
|
||||
"32": 0.027970465568334695,
|
||||
"40": 0.014406812634280746,
|
||||
"48": 0.007354861080531025
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-020",
|
||||
"length": 106,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.0499784330668795,
|
||||
"32": 0.04122577355978497,
|
||||
"40": 0.021592165464748382,
|
||||
"48": 0.011222263753869933
|
||||
},
|
||||
"19": {
|
||||
"0": 2.4914495907758174,
|
||||
"32": 0.028387678466645947,
|
||||
"40": 0.014732006285955,
|
||||
"48": 0.007600996890895566
|
||||
},
|
||||
"23": {
|
||||
"0": 2.333302869555968,
|
||||
"32": 0.028901195362459362,
|
||||
"40": 0.015146381684210501,
|
||||
"48": 0.007708436189913433
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-021",
|
||||
"length": 105,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.000190717302482,
|
||||
"32": 0.036974093576619696,
|
||||
"40": 0.019188918824031505,
|
||||
"48": 0.009750811653384532
|
||||
},
|
||||
"19": {
|
||||
"0": 2.504255342893704,
|
||||
"32": 0.02679008610350141,
|
||||
"40": 0.013656397393850609,
|
||||
"48": 0.007080721321304438
|
||||
},
|
||||
"23": {
|
||||
"0": 2.343114821525361,
|
||||
"32": 0.027011591312553825,
|
||||
"40": 0.014172719903089378,
|
||||
"48": 0.007187917055432581
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-022",
|
||||
"length": 103,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.1429597973216787,
|
||||
"32": 0.03808212093085827,
|
||||
"40": 0.019726271041694738,
|
||||
"48": 0.010127914275230446
|
||||
},
|
||||
"19": {
|
||||
"0": 2.5344581089967053,
|
||||
"32": 0.02599389167658157,
|
||||
"40": 0.013376992897619809,
|
||||
"48": 0.006852960444486019
|
||||
},
|
||||
"23": {
|
||||
"0": 2.291104635624609,
|
||||
"32": 0.02783449426763895,
|
||||
"40": 0.01437474325606307,
|
||||
"48": 0.007167743463725208
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-023",
|
||||
"length": 105,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.048208724265116,
|
||||
"32": 0.04133798446464467,
|
||||
"40": 0.022112363284163734,
|
||||
"48": 0.011560149309456123
|
||||
},
|
||||
"19": {
|
||||
"0": 2.453145924939178,
|
||||
"32": 0.027218736432846176,
|
||||
"40": 0.01452312556436353,
|
||||
"48": 0.007526757521394901
|
||||
},
|
||||
"23": {
|
||||
"0": 2.362423074310092,
|
||||
"32": 0.028603775449443824,
|
||||
"40": 0.015022331711637587,
|
||||
"48": 0.007704925968997894
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,675 @@
|
||||
{
|
||||
"source_receipt_sha256": "682bc035a5bed9f9245f589cacf3e9616300e8bf5e85d3743b1264a56360fa55",
|
||||
"split": "fit",
|
||||
"sites": [
|
||||
15,
|
||||
19,
|
||||
23
|
||||
],
|
||||
"donor_layer": 11,
|
||||
"donor_fit": "affine, opposite index parity",
|
||||
"metric": "mean per-example, per-layer, per-head, all token-pair squared raw score residual",
|
||||
"mean_mse": {
|
||||
"15": {
|
||||
"0": 3.0491509033035786,
|
||||
"32": 0.0395217815948953,
|
||||
"40": 0.020783290371489474,
|
||||
"48": 0.010840281262399469
|
||||
},
|
||||
"19": {
|
||||
"0": 3.857443153106972,
|
||||
"32": 0.04404012339850357,
|
||||
"40": 0.022555703253053838,
|
||||
"48": 0.011519385659275065
|
||||
},
|
||||
"23": {
|
||||
"0": 3.0209357835593145,
|
||||
"32": 0.04279017456139522,
|
||||
"40": 0.022611030031209806,
|
||||
"48": 0.01179076608337388
|
||||
}
|
||||
},
|
||||
"configurations": [
|
||||
{
|
||||
"ranks": [
|
||||
40,
|
||||
40,
|
||||
40
|
||||
],
|
||||
"mean_mse": 0.021983341218584373,
|
||||
"examples_below_uniform_mse": 0
|
||||
},
|
||||
{
|
||||
"ranks": [
|
||||
32,
|
||||
40,
|
||||
48
|
||||
],
|
||||
"mean_mse": 0.024622750310441005,
|
||||
"examples_below_uniform_mse": 0
|
||||
},
|
||||
{
|
||||
"ranks": [
|
||||
32,
|
||||
48,
|
||||
40
|
||||
],
|
||||
"mean_mse": 0.024550732428460054,
|
||||
"examples_below_uniform_mse": 0
|
||||
},
|
||||
{
|
||||
"ranks": [
|
||||
40,
|
||||
32,
|
||||
48
|
||||
],
|
||||
"mean_mse": 0.025538059951122308,
|
||||
"examples_below_uniform_mse": 0
|
||||
},
|
||||
{
|
||||
"ranks": [
|
||||
40,
|
||||
48,
|
||||
32
|
||||
],
|
||||
"mean_mse": 0.02503095019738659,
|
||||
"examples_below_uniform_mse": 0
|
||||
},
|
||||
{
|
||||
"ranks": [
|
||||
48,
|
||||
32,
|
||||
40
|
||||
],
|
||||
"mean_mse": 0.02583047823070428,
|
||||
"examples_below_uniform_mse": 0
|
||||
},
|
||||
{
|
||||
"ranks": [
|
||||
48,
|
||||
40,
|
||||
32
|
||||
],
|
||||
"mean_mse": 0.02539538635894951,
|
||||
"examples_below_uniform_mse": 0
|
||||
}
|
||||
],
|
||||
"examples": [
|
||||
{
|
||||
"id": "fit-lookup-000",
|
||||
"length": 105,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.088659967440397,
|
||||
"32": 0.042362592505534986,
|
||||
"40": 0.022141397788788385,
|
||||
"48": 0.011514037850336351
|
||||
},
|
||||
"19": {
|
||||
"0": 3.9943518537218665,
|
||||
"32": 0.04591974433321144,
|
||||
"40": 0.024057801139955103,
|
||||
"48": 0.012400994145531046
|
||||
},
|
||||
"23": {
|
||||
"0": 3.043062165797575,
|
||||
"32": 0.043840611411928194,
|
||||
"40": 0.023782948692401322,
|
||||
"48": 0.012654655382485485
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-001",
|
||||
"length": 106,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.043755284271191,
|
||||
"32": 0.04146037910762712,
|
||||
"40": 0.021973328312789527,
|
||||
"48": 0.011547387907239248
|
||||
},
|
||||
"19": {
|
||||
"0": 3.9598790566955886,
|
||||
"32": 0.045888230039258966,
|
||||
"40": 0.023175579379109502,
|
||||
"48": 0.011920069339334243
|
||||
},
|
||||
"23": {
|
||||
"0": 3.0228768421518657,
|
||||
"32": 0.04389074185450007,
|
||||
"40": 0.02298613226861967,
|
||||
"48": 0.01201903802540863
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-002",
|
||||
"length": 103,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.1611634458593403,
|
||||
"32": 0.039321211199099954,
|
||||
"40": 0.020199787980594377,
|
||||
"48": 0.010459417590053765
|
||||
},
|
||||
"19": {
|
||||
"0": 3.7504174288845213,
|
||||
"32": 0.04261753426778668,
|
||||
"40": 0.021543287068594312,
|
||||
"48": 0.010728145288211992
|
||||
},
|
||||
"23": {
|
||||
"0": 3.0404045066898244,
|
||||
"32": 0.04148977907847477,
|
||||
"40": 0.021596132424008038,
|
||||
"48": 0.01100976489064943
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-003",
|
||||
"length": 106,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.0409953314068368,
|
||||
"32": 0.03762918598377197,
|
||||
"40": 0.019843534700772446,
|
||||
"48": 0.010574553412406835
|
||||
},
|
||||
"19": {
|
||||
"0": 3.688879228913018,
|
||||
"32": 0.04392129860493001,
|
||||
"40": 0.022968772572630233,
|
||||
"48": 0.011682937781274223
|
||||
},
|
||||
"23": {
|
||||
"0": 2.9696612315728035,
|
||||
"32": 0.04365312259554772,
|
||||
"40": 0.023110205181705423,
|
||||
"48": 0.012251188178660657
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-004",
|
||||
"length": 106,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.021519909278273,
|
||||
"32": 0.040987579290442194,
|
||||
"40": 0.0218709069889447,
|
||||
"48": 0.011580689428509915
|
||||
},
|
||||
"19": {
|
||||
"0": 3.8603281075397944,
|
||||
"32": 0.043717190016046695,
|
||||
"40": 0.022459706664211883,
|
||||
"48": 0.011489303457101622
|
||||
},
|
||||
"23": {
|
||||
"0": 3.0533279734811867,
|
||||
"32": 0.0429414877038192,
|
||||
"40": 0.022566893434764704,
|
||||
"48": 0.011829068992343534
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-005",
|
||||
"length": 106,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.033023410308657,
|
||||
"32": 0.04048812757096736,
|
||||
"40": 0.021191326763191305,
|
||||
"48": 0.011073238036764433
|
||||
},
|
||||
"19": {
|
||||
"0": 3.7947891522935953,
|
||||
"32": 0.046712646076783715,
|
||||
"40": 0.02369760775856494,
|
||||
"48": 0.012093032569584385
|
||||
},
|
||||
"23": {
|
||||
"0": 2.9266299087225995,
|
||||
"32": 0.04418105299845767,
|
||||
"40": 0.023223134094120208,
|
||||
"48": 0.012197499278392794
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-006",
|
||||
"length": 106,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.013331118405758,
|
||||
"32": 0.04131749410468121,
|
||||
"40": 0.022042406028810024,
|
||||
"48": 0.011636497469555753
|
||||
},
|
||||
"19": {
|
||||
"0": 3.823321135345336,
|
||||
"32": 0.043444020469542224,
|
||||
"40": 0.023039572744899546,
|
||||
"48": 0.012151077808294013
|
||||
},
|
||||
"23": {
|
||||
"0": 3.0123366474248527,
|
||||
"32": 0.043892186138404905,
|
||||
"40": 0.023768489833834446,
|
||||
"48": 0.012493576292187758
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-007",
|
||||
"length": 106,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 2.9797496554592016,
|
||||
"32": 0.040086780980416785,
|
||||
"40": 0.021471205229520056,
|
||||
"48": 0.011298897793875544
|
||||
},
|
||||
"19": {
|
||||
"0": 3.826629680630135,
|
||||
"32": 0.046253373518954505,
|
||||
"40": 0.02394178399044027,
|
||||
"48": 0.012263827559098354
|
||||
},
|
||||
"23": {
|
||||
"0": 3.0080892417871485,
|
||||
"32": 0.04416354613658148,
|
||||
"40": 0.02347209773759818,
|
||||
"48": 0.01214014313596462
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-008",
|
||||
"length": 106,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.0195279869049405,
|
||||
"32": 0.04027418538529785,
|
||||
"40": 0.021116286802696546,
|
||||
"48": 0.010885256441784051
|
||||
},
|
||||
"19": {
|
||||
"0": 3.9049296662519,
|
||||
"32": 0.044775724860484895,
|
||||
"40": 0.023020902804934695,
|
||||
"48": 0.01181115860807368
|
||||
},
|
||||
"23": {
|
||||
"0": 3.022332594278084,
|
||||
"32": 0.04271748172881601,
|
||||
"40": 0.022841955815524173,
|
||||
"48": 0.011960985252592796
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-009",
|
||||
"length": 105,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.109396586760397,
|
||||
"32": 0.03755905434822013,
|
||||
"40": 0.019840372604972886,
|
||||
"48": 0.010344465475210856
|
||||
},
|
||||
"19": {
|
||||
"0": 3.889074040521854,
|
||||
"32": 0.042862804080481424,
|
||||
"40": 0.021958251337402295,
|
||||
"48": 0.011303882000132073
|
||||
},
|
||||
"23": {
|
||||
"0": 3.036374564918723,
|
||||
"32": 0.042727702436651936,
|
||||
"40": 0.022601026341831074,
|
||||
"48": 0.011770845282018036
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-010",
|
||||
"length": 107,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.0311224516019055,
|
||||
"32": 0.04091108401342758,
|
||||
"40": 0.0218021374757848,
|
||||
"48": 0.01159018725724504
|
||||
},
|
||||
"19": {
|
||||
"0": 3.9363469267180835,
|
||||
"32": 0.04567514334168894,
|
||||
"40": 0.02376781635912793,
|
||||
"48": 0.012322024685530862
|
||||
},
|
||||
"23": {
|
||||
"0": 3.014115868352978,
|
||||
"32": 0.044461534712689404,
|
||||
"40": 0.023592730803344734,
|
||||
"48": 0.012495188587781836
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-011",
|
||||
"length": 106,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 2.978140786774898,
|
||||
"32": 0.0387811816167493,
|
||||
"40": 0.02037526802543315,
|
||||
"48": 0.0106736184315463
|
||||
},
|
||||
"19": {
|
||||
"0": 3.844477663585858,
|
||||
"32": 0.045556113791662724,
|
||||
"40": 0.023331656132232113,
|
||||
"48": 0.011906942552667195
|
||||
},
|
||||
"23": {
|
||||
"0": 2.9601191176649757,
|
||||
"32": 0.043240836434076536,
|
||||
"40": 0.02260293695313534,
|
||||
"48": 0.0119007769151467
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-012",
|
||||
"length": 107,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.0087156260860324,
|
||||
"32": 0.039908258905094175,
|
||||
"40": 0.02095174812968115,
|
||||
"48": 0.010945949375037204
|
||||
},
|
||||
"19": {
|
||||
"0": 3.8500214677028963,
|
||||
"32": 0.04244640193219456,
|
||||
"40": 0.021656130249074597,
|
||||
"48": 0.011118828008838963
|
||||
},
|
||||
"23": {
|
||||
"0": 3.012859888829719,
|
||||
"32": 0.04171247094948818,
|
||||
"40": 0.0222639528061427,
|
||||
"48": 0.011602191423433644
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-013",
|
||||
"length": 105,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.090885110032237,
|
||||
"32": 0.03762876468904888,
|
||||
"40": 0.019838887261469686,
|
||||
"48": 0.010323019538322325
|
||||
},
|
||||
"19": {
|
||||
"0": 3.8526016885782073,
|
||||
"32": 0.04267441235679496,
|
||||
"40": 0.021965440593552564,
|
||||
"48": 0.011204493115001445
|
||||
},
|
||||
"23": {
|
||||
"0": 2.9829829723700807,
|
||||
"32": 0.04183375644979849,
|
||||
"40": 0.022193649610459963,
|
||||
"48": 0.0116555170847707
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-014",
|
||||
"length": 105,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.1381995988564113,
|
||||
"32": 0.0394204188617157,
|
||||
"40": 0.02086813289927566,
|
||||
"48": 0.010854347550869876
|
||||
},
|
||||
"19": {
|
||||
"0": 3.96491581298912,
|
||||
"32": 0.044485907588952385,
|
||||
"40": 0.022877678884423304,
|
||||
"48": 0.01175281372917842
|
||||
},
|
||||
"23": {
|
||||
"0": 3.056772542795872,
|
||||
"32": 0.04255880849165352,
|
||||
"40": 0.022612492155258415,
|
||||
"48": 0.011914870920016675
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-015",
|
||||
"length": 104,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.069267210462956,
|
||||
"32": 0.037746196997427636,
|
||||
"40": 0.01989923322963685,
|
||||
"48": 0.01029592139206914
|
||||
},
|
||||
"19": {
|
||||
"0": 3.8705993446575504,
|
||||
"32": 0.042685739359091625,
|
||||
"40": 0.021382466243261136,
|
||||
"48": 0.01075929182481224
|
||||
},
|
||||
"23": {
|
||||
"0": 3.0856817422797613,
|
||||
"32": 0.041619385601778976,
|
||||
"40": 0.021868313984371644,
|
||||
"48": 0.0112163979206816
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-016",
|
||||
"length": 106,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.0007538969450036,
|
||||
"32": 0.03916077842933743,
|
||||
"40": 0.02049354544660005,
|
||||
"48": 0.010682154227783142
|
||||
},
|
||||
"19": {
|
||||
"0": 3.870593473010357,
|
||||
"32": 0.04499375247587852,
|
||||
"40": 0.023060264604825936,
|
||||
"48": 0.011894306441044961
|
||||
},
|
||||
"23": {
|
||||
"0": 3.0078244299495527,
|
||||
"32": 0.04343119038793748,
|
||||
"40": 0.02305271005274073,
|
||||
"48": 0.012061257691392924
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-017",
|
||||
"length": 104,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.097493153149072,
|
||||
"32": 0.03850921447926982,
|
||||
"40": 0.019769321682123944,
|
||||
"48": 0.010122230466840933
|
||||
},
|
||||
"19": {
|
||||
"0": 3.820263396381217,
|
||||
"32": 0.04169650174393219,
|
||||
"40": 0.020890787003452566,
|
||||
"48": 0.010491055604303079
|
||||
},
|
||||
"23": {
|
||||
"0": 3.055860371881066,
|
||||
"32": 0.04156449816886682,
|
||||
"40": 0.02182786872676137,
|
||||
"48": 0.011057894501810384
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-018",
|
||||
"length": 108,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.0013828310609028,
|
||||
"32": 0.03971017933680604,
|
||||
"40": 0.021048825625806546,
|
||||
"48": 0.011115656621268686
|
||||
},
|
||||
"19": {
|
||||
"0": 3.8060033369100768,
|
||||
"32": 0.04542715302568046,
|
||||
"40": 0.023526612657494325,
|
||||
"48": 0.012077680832697587
|
||||
},
|
||||
"23": {
|
||||
"0": 3.0269971279675176,
|
||||
"32": 0.04410912108278284,
|
||||
"40": 0.023608312332425496,
|
||||
"48": 0.012556557224355341
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-019",
|
||||
"length": 103,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.0112006462653227,
|
||||
"32": 0.037640117940643265,
|
||||
"40": 0.019441597324216846,
|
||||
"48": 0.009988085038926717
|
||||
},
|
||||
"19": {
|
||||
"0": 3.8768517398640947,
|
||||
"32": 0.04158191015113058,
|
||||
"40": 0.020643499621951257,
|
||||
"48": 0.01039837221786275
|
||||
},
|
||||
"23": {
|
||||
"0": 3.065298751963704,
|
||||
"32": 0.040825522024696886,
|
||||
"40": 0.021289032661542927,
|
||||
"48": 0.010876842781099974
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-020",
|
||||
"length": 106,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.0499784330668804,
|
||||
"32": 0.04122577355978493,
|
||||
"40": 0.021592165464748375,
|
||||
"48": 0.011222263753869931
|
||||
},
|
||||
"19": {
|
||||
"0": 3.8824985292132834,
|
||||
"32": 0.04492968673719023,
|
||||
"40": 0.022922977828289975,
|
||||
"48": 0.011503317232916728
|
||||
},
|
||||
"23": {
|
||||
"0": 3.033711254655971,
|
||||
"32": 0.043830061367554726,
|
||||
"40": 0.02317944512208468,
|
||||
"48": 0.012154593458581674
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-021",
|
||||
"length": 105,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.0001907173024827,
|
||||
"32": 0.03697409357661978,
|
||||
"40": 0.019188918824031547,
|
||||
"48": 0.009750811653384558
|
||||
},
|
||||
"19": {
|
||||
"0": 3.766616992263308,
|
||||
"32": 0.042624045486801626,
|
||||
"40": 0.02124433468816115,
|
||||
"48": 0.010587855522900326
|
||||
},
|
||||
"23": {
|
||||
"0": 2.9766873470897104,
|
||||
"32": 0.041481534529769944,
|
||||
"40": 0.02121486238795562,
|
||||
"48": 0.010788750140809036
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-022",
|
||||
"length": 103,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.1429597973216787,
|
||||
"32": 0.03808212093085823,
|
||||
"40": 0.019726271041694728,
|
||||
"48": 0.010127914275230436
|
||||
},
|
||||
"19": {
|
||||
"0": 3.8598970499663743,
|
||||
"32": 0.04248202181605006,
|
||||
"40": 0.0214628237211103,
|
||||
"48": 0.010853348943230156
|
||||
},
|
||||
"23": {
|
||||
"0": 3.049645123879466,
|
||||
"32": 0.039979464021990575,
|
||||
"40": 0.02080617789667549,
|
||||
"48": 0.010634926145447776
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-023",
|
||||
"length": 105,
|
||||
"mse": {
|
||||
"15": {
|
||||
"0": 3.048208724265116,
|
||||
"32": 0.041337984464644754,
|
||||
"40": 0.022112363284163796,
|
||||
"48": 0.011560149309456157
|
||||
},
|
||||
"19": {
|
||||
"0": 3.8843489019292843,
|
||||
"32": 0.043591605489556345,
|
||||
"40": 0.02274112402559217,
|
||||
"48": 0.011750496554981203
|
||||
},
|
||||
"23": {
|
||||
"0": 3.0388065889185087,
|
||||
"32": 0.04281829316721918,
|
||||
"40": 0.022603219431728962,
|
||||
"48": 0.01173585649494112
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,245 @@
|
||||
{
|
||||
"questions": 64,
|
||||
"generation": {
|
||||
"native": {
|
||||
"generated_tokens": 192,
|
||||
"seconds": 6068.248262333684
|
||||
},
|
||||
"direct": {
|
||||
"generated_tokens": 200,
|
||||
"seconds": 6897.0262435870245
|
||||
},
|
||||
"prior-lisa": {
|
||||
"generated_tokens": 192,
|
||||
"seconds": 5927.9223870411515
|
||||
},
|
||||
"trajectory-student": {
|
||||
"generated_tokens": 192,
|
||||
"seconds": 5778.201935075223
|
||||
},
|
||||
"trajectory-reference": {
|
||||
"generated_tokens": 192,
|
||||
"seconds": 5985.037969658151
|
||||
},
|
||||
"shared-uniform": {
|
||||
"generated_tokens": 192,
|
||||
"seconds": 5935.001401695423
|
||||
},
|
||||
"shared-allocated": {
|
||||
"generated_tokens": 192,
|
||||
"seconds": 5566.861944464035
|
||||
},
|
||||
"shared-reversed": {
|
||||
"generated_tokens": 192,
|
||||
"seconds": 5581.20324316062
|
||||
},
|
||||
"local-uniform": {
|
||||
"generated_tokens": 192,
|
||||
"seconds": 5951.301571980119
|
||||
},
|
||||
"local-allocated": {
|
||||
"generated_tokens": 192,
|
||||
"seconds": 6095.840784574859
|
||||
}
|
||||
},
|
||||
"changed_answers": {
|
||||
"pairwise": {
|
||||
"rank-vs-uniform": {
|
||||
"corrected": [
|
||||
"test-024-1",
|
||||
"test-030-0"
|
||||
],
|
||||
"lost": [
|
||||
"test-007-0",
|
||||
"test-013-1",
|
||||
"test-018-1",
|
||||
"test-019-1",
|
||||
"test-020-1"
|
||||
]
|
||||
},
|
||||
"rank-vs-prior": {
|
||||
"corrected": [
|
||||
"test-024-1",
|
||||
"test-030-0"
|
||||
],
|
||||
"lost": [
|
||||
"test-007-0",
|
||||
"test-013-1",
|
||||
"test-018-1",
|
||||
"test-019-1",
|
||||
"test-020-1"
|
||||
]
|
||||
},
|
||||
"rank-vs-reversed": {
|
||||
"corrected": [
|
||||
"test-000-1",
|
||||
"test-012-1",
|
||||
"test-024-1",
|
||||
"test-030-0"
|
||||
],
|
||||
"lost": [
|
||||
"test-007-1",
|
||||
"test-012-0",
|
||||
"test-019-0",
|
||||
"test-019-1",
|
||||
"test-020-1",
|
||||
"test-026-1"
|
||||
]
|
||||
},
|
||||
"rank-vs-local": {
|
||||
"corrected": [
|
||||
"test-000-1",
|
||||
"test-004-0",
|
||||
"test-023-0",
|
||||
"test-024-1",
|
||||
"test-025-1",
|
||||
"test-030-0",
|
||||
"test-031-0"
|
||||
],
|
||||
"lost": [
|
||||
"test-019-0",
|
||||
"test-026-1"
|
||||
]
|
||||
},
|
||||
"student-vs-prior": {
|
||||
"corrected": [
|
||||
"test-004-1",
|
||||
"test-005-0",
|
||||
"test-011-1",
|
||||
"test-022-1",
|
||||
"test-024-1",
|
||||
"test-030-0"
|
||||
],
|
||||
"lost": [
|
||||
"test-007-0",
|
||||
"test-013-1",
|
||||
"test-019-1",
|
||||
"test-020-1",
|
||||
"test-031-0"
|
||||
]
|
||||
},
|
||||
"reference-vs-prior": {
|
||||
"corrected": [
|
||||
"test-021-1",
|
||||
"test-024-1",
|
||||
"test-030-0"
|
||||
],
|
||||
"lost": [
|
||||
"test-007-0",
|
||||
"test-009-0",
|
||||
"test-013-1",
|
||||
"test-019-1",
|
||||
"test-020-1",
|
||||
"test-031-0"
|
||||
]
|
||||
},
|
||||
"student-vs-reference": {
|
||||
"corrected": [
|
||||
"test-004-1",
|
||||
"test-005-0",
|
||||
"test-009-0",
|
||||
"test-011-1",
|
||||
"test-022-1"
|
||||
],
|
||||
"lost": [
|
||||
"test-021-1"
|
||||
]
|
||||
}
|
||||
},
|
||||
"rank_combination": {
|
||||
"corrected_against_both": [
|
||||
{
|
||||
"id": "test-024-1",
|
||||
"local_uniform_correct": false
|
||||
},
|
||||
{
|
||||
"id": "test-030-0",
|
||||
"local_uniform_correct": false
|
||||
}
|
||||
],
|
||||
"lost_against_both": []
|
||||
}
|
||||
},
|
||||
"correct": {
|
||||
"native": 64,
|
||||
"direct": 0,
|
||||
"prior-lisa": 13,
|
||||
"trajectory-student": 14,
|
||||
"trajectory-reference": 10,
|
||||
"shared-uniform": 13,
|
||||
"shared-allocated": 10,
|
||||
"shared-reversed": 12,
|
||||
"local-uniform": 3,
|
||||
"local-allocated": 5
|
||||
},
|
||||
"pairs_both_correct": {
|
||||
"native": 32,
|
||||
"direct": 0,
|
||||
"prior-lisa": 0,
|
||||
"trajectory-student": 2,
|
||||
"trajectory-reference": 0,
|
||||
"shared-uniform": 0,
|
||||
"shared-allocated": 0,
|
||||
"shared-reversed": 1,
|
||||
"local-uniform": 0,
|
||||
"local-allocated": 0
|
||||
},
|
||||
"paired_differences": {
|
||||
"rank-vs-uniform": {
|
||||
"delta": -0.046875,
|
||||
"interval_95": [
|
||||
-0.125,
|
||||
0.03125
|
||||
]
|
||||
},
|
||||
"rank-vs-prior": {
|
||||
"delta": -0.046875,
|
||||
"interval_95": [
|
||||
-0.125,
|
||||
0.03125
|
||||
]
|
||||
},
|
||||
"rank-vs-reversed": {
|
||||
"delta": -0.03125,
|
||||
"interval_95": [
|
||||
-0.125,
|
||||
0.0625
|
||||
]
|
||||
},
|
||||
"rank-vs-local": {
|
||||
"delta": 0.078125,
|
||||
"interval_95": [
|
||||
-0.015625,
|
||||
0.171875
|
||||
]
|
||||
},
|
||||
"rank-interaction": {
|
||||
"delta": -0.078125,
|
||||
"interval_95": [
|
||||
-0.171875,
|
||||
0.015625
|
||||
]
|
||||
},
|
||||
"student-vs-prior": {
|
||||
"delta": 0.015625,
|
||||
"interval_95": [
|
||||
-0.078125,
|
||||
0.109375
|
||||
]
|
||||
},
|
||||
"reference-vs-prior": {
|
||||
"delta": -0.046875,
|
||||
"interval_95": [
|
||||
-0.140625,
|
||||
0.046875
|
||||
]
|
||||
},
|
||||
"student-vs-reference": {
|
||||
"delta": 0.0625,
|
||||
"interval_95": [
|
||||
0.0,
|
||||
0.140625
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
"28efbaf94a5034333339a35f08ead151459a7d20c6c2d2f07a451e7f3bf154de"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
"0ba8425d353a10fff867359ffe3445517d0a3699d0d38688d0f424851845a77b"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
"3818a10a7de60d498dc4860b877e8b7d9d9e2bebe1bb6627b442faad2eb85900"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
"28efbaf94a5034333339a35f08ead151459a7d20c6c2d2f07a451e7f3bf154de"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
"c82db5af7fa42cf58a349f3e53961da2360b211a7ed606f53a728860c64f6f29"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
"f77ab651298bb59af17d43bdf7a2bb9102b8f90ee45db2d8f8fd579c2557e31b"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
"478213fc412b70a1ef0bfed735d22950dfc1bff396bff36b771a2d235849ff1d"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
"c82db5af7fa42cf58a349f3e53961da2360b211a7ed606f53a728860c64f6f29"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
"21ae007cb7343c1a0042655824bdc98ee2f03071d5f5dc43dbc8b441a262d84f"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
"7faacdffbc81d0c786ef0c7a5acaf1724d82af155fed7b834dabc73dcf91f3a4"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,278 @@
|
||||
{
|
||||
"questions": 64,
|
||||
"pairs": 32,
|
||||
"arms": 10,
|
||||
"verified_generations": 640,
|
||||
"verified_bootstrap_draws": 10000,
|
||||
"source_digests": {
|
||||
"native": "28efbaf94a5034333339a35f08ead151459a7d20c6c2d2f07a451e7f3bf154de",
|
||||
"direct": "28efbaf94a5034333339a35f08ead151459a7d20c6c2d2f07a451e7f3bf154de",
|
||||
"prior-lisa": "c82db5af7fa42cf58a349f3e53961da2360b211a7ed606f53a728860c64f6f29",
|
||||
"trajectory-student": "7faacdffbc81d0c786ef0c7a5acaf1724d82af155fed7b834dabc73dcf91f3a4",
|
||||
"trajectory-reference": "21ae007cb7343c1a0042655824bdc98ee2f03071d5f5dc43dbc8b441a262d84f",
|
||||
"shared-uniform": "c82db5af7fa42cf58a349f3e53961da2360b211a7ed606f53a728860c64f6f29",
|
||||
"shared-allocated": "f77ab651298bb59af17d43bdf7a2bb9102b8f90ee45db2d8f8fd579c2557e31b",
|
||||
"shared-reversed": "478213fc412b70a1ef0bfed735d22950dfc1bff396bff36b771a2d235849ff1d",
|
||||
"local-uniform": "3818a10a7de60d498dc4860b877e8b7d9d9e2bebe1bb6627b442faad2eb85900",
|
||||
"local-allocated": "0ba8425d353a10fff867359ffe3445517d0a3699d0d38688d0f424851845a77b"
|
||||
},
|
||||
"raw_answer_digests": {
|
||||
"native": "0cac1310079c76b14cb35fc621b3bca59f188be0ed71c28eee9f0ec73499ba45",
|
||||
"direct": "46c37253456273301a5e5b11b10afea4bacab74b75e91be055d6366160f51425",
|
||||
"prior-lisa": "b03354015a13dba4566d4623bbfc7c49f83b972eae98179fd0efc971ad060cba",
|
||||
"trajectory-student": "74ef78733ba51db1407c4ffac4e051b06376a340b22cc9201aab3ac2b9edcf13",
|
||||
"trajectory-reference": "26fd06fc2e66db0fefe7808b46148f9a64432710adccb80b205b7f145166194d",
|
||||
"shared-uniform": "b88a16b4b7bf022e466e4ad2702e15121868fd3d456f5ed8f48c4302dbb646ed",
|
||||
"shared-allocated": "f53bc22378e3e87b83890e38717670f9e3b88ae4fcc984c6301543e280a90fba",
|
||||
"shared-reversed": "b09640ab761dfccb9a665fb9a6d1a622a7da142fd8281c6901d86d1555f4ef9d",
|
||||
"local-uniform": "6fa1be866d6c47fda8c9e3c523e02bc815604e1462ddf78fc97bb7fa70343dd1",
|
||||
"local-allocated": "0a42b0835375750d33f5e19fa03e0d62fa9dfb9e3ccb946c33c4f8e106ca00c6"
|
||||
},
|
||||
"normal_stops": {
|
||||
"native": 64,
|
||||
"direct": 64,
|
||||
"prior-lisa": 64,
|
||||
"trajectory-student": 64,
|
||||
"trajectory-reference": 64,
|
||||
"shared-uniform": 64,
|
||||
"shared-allocated": 64,
|
||||
"shared-reversed": 64,
|
||||
"local-uniform": 64,
|
||||
"local-allocated": 64
|
||||
},
|
||||
"generation": {
|
||||
"native": {
|
||||
"batches": 32,
|
||||
"generated_tokens": 192,
|
||||
"seconds": 6068.248262333684
|
||||
},
|
||||
"direct": {
|
||||
"batches": 32,
|
||||
"generated_tokens": 200,
|
||||
"seconds": 6897.0262435870245
|
||||
},
|
||||
"prior-lisa": {
|
||||
"batches": 32,
|
||||
"generated_tokens": 192,
|
||||
"seconds": 5927.9223870411515
|
||||
},
|
||||
"trajectory-student": {
|
||||
"batches": 32,
|
||||
"generated_tokens": 192,
|
||||
"seconds": 5778.201935075223
|
||||
},
|
||||
"trajectory-reference": {
|
||||
"batches": 32,
|
||||
"generated_tokens": 192,
|
||||
"seconds": 5985.037969658151
|
||||
},
|
||||
"shared-uniform": {
|
||||
"batches": 32,
|
||||
"generated_tokens": 192,
|
||||
"seconds": 5935.001401695423
|
||||
},
|
||||
"shared-allocated": {
|
||||
"batches": 32,
|
||||
"generated_tokens": 192,
|
||||
"seconds": 5566.861944464035
|
||||
},
|
||||
"shared-reversed": {
|
||||
"batches": 32,
|
||||
"generated_tokens": 192,
|
||||
"seconds": 5581.20324316062
|
||||
},
|
||||
"local-uniform": {
|
||||
"batches": 32,
|
||||
"generated_tokens": 192,
|
||||
"seconds": 5951.301571980119
|
||||
},
|
||||
"local-allocated": {
|
||||
"batches": 32,
|
||||
"generated_tokens": 192,
|
||||
"seconds": 6095.840784574859
|
||||
}
|
||||
},
|
||||
"audit_sha256": "f15f014aa4662c3dc7a94dfcd62349671c88307e956c3c0a434a5dbd6a1ab424",
|
||||
"protocol_sha256": "6858dbc64db0b989e8112e9dbea70662a2a05f66f11b180e8f2c668c74c43aef",
|
||||
"tokenizer_sha256": "5f9e4d4901a92b997e463c1f46055088b6cca5ca61a6522d1b9f64c4bb81cb42",
|
||||
"uniform_tensors_equal_prior": true,
|
||||
"uniform_same_token_streams_as_prior": 64,
|
||||
"native_correct_direct_wrong_integer": [
|
||||
"test-000-0",
|
||||
"test-000-1",
|
||||
"test-001-0",
|
||||
"test-001-1",
|
||||
"test-002-0",
|
||||
"test-002-1",
|
||||
"test-003-0",
|
||||
"test-003-1",
|
||||
"test-004-0",
|
||||
"test-004-1",
|
||||
"test-005-0",
|
||||
"test-005-1",
|
||||
"test-006-0",
|
||||
"test-006-1",
|
||||
"test-007-0",
|
||||
"test-007-1",
|
||||
"test-008-0",
|
||||
"test-008-1",
|
||||
"test-009-0",
|
||||
"test-009-1",
|
||||
"test-010-0",
|
||||
"test-010-1",
|
||||
"test-011-0",
|
||||
"test-011-1",
|
||||
"test-012-0",
|
||||
"test-012-1",
|
||||
"test-013-0",
|
||||
"test-013-1",
|
||||
"test-014-0",
|
||||
"test-014-1",
|
||||
"test-015-0",
|
||||
"test-015-1",
|
||||
"test-016-0",
|
||||
"test-016-1",
|
||||
"test-017-0",
|
||||
"test-017-1",
|
||||
"test-018-0",
|
||||
"test-018-1",
|
||||
"test-019-0",
|
||||
"test-019-1",
|
||||
"test-020-0",
|
||||
"test-020-1",
|
||||
"test-021-0",
|
||||
"test-021-1",
|
||||
"test-022-0",
|
||||
"test-022-1",
|
||||
"test-023-0",
|
||||
"test-023-1",
|
||||
"test-024-0",
|
||||
"test-024-1",
|
||||
"test-025-0",
|
||||
"test-025-1",
|
||||
"test-026-0",
|
||||
"test-026-1",
|
||||
"test-027-0",
|
||||
"test-027-1",
|
||||
"test-028-0",
|
||||
"test-028-1",
|
||||
"test-029-0",
|
||||
"test-029-1",
|
||||
"test-030-0",
|
||||
"test-030-1",
|
||||
"test-031-0",
|
||||
"test-031-1"
|
||||
],
|
||||
"recovered_direct_wrong_integer": {
|
||||
"prior-lisa": [
|
||||
"test-000-1",
|
||||
"test-004-0",
|
||||
"test-007-0",
|
||||
"test-009-0",
|
||||
"test-012-1",
|
||||
"test-013-1",
|
||||
"test-018-1",
|
||||
"test-019-1",
|
||||
"test-020-1",
|
||||
"test-022-0",
|
||||
"test-023-0",
|
||||
"test-025-1",
|
||||
"test-031-0"
|
||||
],
|
||||
"trajectory-student": [
|
||||
"test-000-1",
|
||||
"test-004-0",
|
||||
"test-004-1",
|
||||
"test-005-0",
|
||||
"test-009-0",
|
||||
"test-011-1",
|
||||
"test-012-1",
|
||||
"test-018-1",
|
||||
"test-022-0",
|
||||
"test-022-1",
|
||||
"test-023-0",
|
||||
"test-024-1",
|
||||
"test-025-1",
|
||||
"test-030-0"
|
||||
],
|
||||
"trajectory-reference": [
|
||||
"test-000-1",
|
||||
"test-004-0",
|
||||
"test-012-1",
|
||||
"test-018-1",
|
||||
"test-021-1",
|
||||
"test-022-0",
|
||||
"test-023-0",
|
||||
"test-024-1",
|
||||
"test-025-1",
|
||||
"test-030-0"
|
||||
],
|
||||
"shared-uniform": [
|
||||
"test-000-1",
|
||||
"test-004-0",
|
||||
"test-007-0",
|
||||
"test-009-0",
|
||||
"test-012-1",
|
||||
"test-013-1",
|
||||
"test-018-1",
|
||||
"test-019-1",
|
||||
"test-020-1",
|
||||
"test-022-0",
|
||||
"test-023-0",
|
||||
"test-025-1",
|
||||
"test-031-0"
|
||||
],
|
||||
"shared-allocated": [
|
||||
"test-000-1",
|
||||
"test-004-0",
|
||||
"test-009-0",
|
||||
"test-012-1",
|
||||
"test-022-0",
|
||||
"test-023-0",
|
||||
"test-024-1",
|
||||
"test-025-1",
|
||||
"test-030-0",
|
||||
"test-031-0"
|
||||
],
|
||||
"shared-reversed": [
|
||||
"test-004-0",
|
||||
"test-007-1",
|
||||
"test-009-0",
|
||||
"test-012-0",
|
||||
"test-019-0",
|
||||
"test-019-1",
|
||||
"test-020-1",
|
||||
"test-022-0",
|
||||
"test-023-0",
|
||||
"test-025-1",
|
||||
"test-026-1",
|
||||
"test-031-0"
|
||||
],
|
||||
"local-uniform": [
|
||||
"test-009-0",
|
||||
"test-012-1",
|
||||
"test-022-0"
|
||||
],
|
||||
"local-allocated": [
|
||||
"test-009-0",
|
||||
"test-012-1",
|
||||
"test-019-0",
|
||||
"test-022-0",
|
||||
"test-026-1"
|
||||
]
|
||||
},
|
||||
"unparsed_full_answers": {
|
||||
"native": 0,
|
||||
"direct": 0,
|
||||
"prior-lisa": 0,
|
||||
"trajectory-student": 0,
|
||||
"trajectory-reference": 0,
|
||||
"shared-uniform": 0,
|
||||
"shared-allocated": 0,
|
||||
"shared-reversed": 0,
|
||||
"local-uniform": 0,
|
||||
"local-allocated": 0
|
||||
},
|
||||
"joint_recoveries": 2,
|
||||
"joint_losses": 0
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"diagnostic_correct": {
|
||||
"baseline": 0,
|
||||
"restore-15": 15,
|
||||
"restore-19": 16,
|
||||
"restore-23": 1
|
||||
},
|
||||
"ranks": {
|
||||
"19": 48,
|
||||
"15": 40,
|
||||
"23": 32
|
||||
},
|
||||
"shared": false,
|
||||
"parameters": 2476032,
|
||||
"seed": 621011,
|
||||
"epochs": 2
|
||||
}
|
||||
@@ -0,0 +1,835 @@
|
||||
{
|
||||
"selected_epoch": 1,
|
||||
"epochs": [
|
||||
{
|
||||
"epoch": 1,
|
||||
"steps": [
|
||||
{
|
||||
"capture": "000.npz",
|
||||
"huber": 6.528413772583008,
|
||||
"completion_ce": 3.6726181507110596
|
||||
},
|
||||
{
|
||||
"capture": "001.npz",
|
||||
"huber": 6.4965386390686035,
|
||||
"completion_ce": 2.961697816848755
|
||||
},
|
||||
{
|
||||
"capture": "002.npz",
|
||||
"huber": 6.580257892608643,
|
||||
"completion_ce": 2.6561381816864014
|
||||
},
|
||||
{
|
||||
"capture": "003.npz",
|
||||
"huber": 6.5543742179870605,
|
||||
"completion_ce": 1.5981636047363281
|
||||
},
|
||||
{
|
||||
"capture": "004.npz",
|
||||
"huber": 6.484375,
|
||||
"completion_ce": 1.529937744140625
|
||||
},
|
||||
{
|
||||
"capture": "005.npz",
|
||||
"huber": 6.517145156860352,
|
||||
"completion_ce": 1.1036376953125
|
||||
},
|
||||
{
|
||||
"capture": "006.npz",
|
||||
"huber": 6.526109218597412,
|
||||
"completion_ce": 1.3270797729492188
|
||||
},
|
||||
{
|
||||
"capture": "007.npz",
|
||||
"huber": 6.490737438201904,
|
||||
"completion_ce": 1.3933900594711304
|
||||
},
|
||||
{
|
||||
"capture": "008.npz",
|
||||
"huber": 6.437219142913818,
|
||||
"completion_ce": 1.8187528848648071
|
||||
},
|
||||
{
|
||||
"capture": "009.npz",
|
||||
"huber": 6.490071773529053,
|
||||
"completion_ce": 1.5282396078109741
|
||||
},
|
||||
{
|
||||
"capture": "010.npz",
|
||||
"huber": 6.410719394683838,
|
||||
"completion_ce": 0.86445552110672
|
||||
},
|
||||
{
|
||||
"capture": "011.npz",
|
||||
"huber": 6.429389953613281,
|
||||
"completion_ce": 1.8247464895248413
|
||||
},
|
||||
{
|
||||
"capture": "012.npz",
|
||||
"huber": 6.436442852020264,
|
||||
"completion_ce": 1.8924471139907837
|
||||
},
|
||||
{
|
||||
"capture": "013.npz",
|
||||
"huber": 6.344142913818359,
|
||||
"completion_ce": 0.9026711583137512
|
||||
},
|
||||
{
|
||||
"capture": "014.npz",
|
||||
"huber": 6.27135705947876,
|
||||
"completion_ce": 0.9396006464958191
|
||||
},
|
||||
{
|
||||
"capture": "015.npz",
|
||||
"huber": 6.2953033447265625,
|
||||
"completion_ce": 1.4760055541992188
|
||||
},
|
||||
{
|
||||
"capture": "016.npz",
|
||||
"huber": 6.295759677886963,
|
||||
"completion_ce": 0.6382783055305481
|
||||
},
|
||||
{
|
||||
"capture": "017.npz",
|
||||
"huber": 6.32208776473999,
|
||||
"completion_ce": 2.3508098125457764
|
||||
},
|
||||
{
|
||||
"capture": "018.npz",
|
||||
"huber": 6.3210225105285645,
|
||||
"completion_ce": 1.7402610778808594
|
||||
},
|
||||
{
|
||||
"capture": "019.npz",
|
||||
"huber": 6.229608058929443,
|
||||
"completion_ce": 0.6156425476074219
|
||||
},
|
||||
{
|
||||
"capture": "020.npz",
|
||||
"huber": 6.207843780517578,
|
||||
"completion_ce": 1.4771957397460938
|
||||
},
|
||||
{
|
||||
"capture": "021.npz",
|
||||
"huber": 6.1026530265808105,
|
||||
"completion_ce": 1.9676717519760132
|
||||
},
|
||||
{
|
||||
"capture": "022.npz",
|
||||
"huber": 6.168865203857422,
|
||||
"completion_ce": 1.2496522665023804
|
||||
},
|
||||
{
|
||||
"capture": "023.npz",
|
||||
"huber": 6.112529754638672,
|
||||
"completion_ce": 0.9298775792121887
|
||||
}
|
||||
],
|
||||
"validation": [
|
||||
{
|
||||
"id": "validation-000-0",
|
||||
"task": "lookup",
|
||||
"gold": 44,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "92<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 92,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-000-1",
|
||||
"task": "lookup",
|
||||
"gold": 91,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "92<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 92,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-0",
|
||||
"task": "lookup",
|
||||
"gold": 33,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-1",
|
||||
"task": "lookup",
|
||||
"gold": 28,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-0",
|
||||
"task": "lookup",
|
||||
"gold": 42,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-1",
|
||||
"task": "lookup",
|
||||
"gold": 56,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-0",
|
||||
"task": "lookup",
|
||||
"gold": 93,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-1",
|
||||
"task": "lookup",
|
||||
"gold": 83,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-0",
|
||||
"task": "lookup",
|
||||
"gold": 23,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
23,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "89<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 89,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-1",
|
||||
"task": "lookup",
|
||||
"gold": 89,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
23,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "89<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 89,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-0",
|
||||
"task": "lookup",
|
||||
"gold": 63,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "42<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 42,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-1",
|
||||
"task": "lookup",
|
||||
"gold": 49,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "42<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 42,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-0",
|
||||
"task": "lookup",
|
||||
"gold": 78,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
22,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "79<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 79,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-1",
|
||||
"task": "lookup",
|
||||
"gold": 29,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
22,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "79<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 79,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-0",
|
||||
"task": "lookup",
|
||||
"gold": 64,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-1",
|
||||
"task": "lookup",
|
||||
"gold": 50,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
21,
|
||||
248046
|
||||
],
|
||||
"response": "96<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 96,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"epoch": 2,
|
||||
"steps": [
|
||||
{
|
||||
"capture": "000.npz",
|
||||
"huber": 6.010594844818115,
|
||||
"completion_ce": 1.6671333312988281
|
||||
},
|
||||
{
|
||||
"capture": "001.npz",
|
||||
"huber": 5.924450397491455,
|
||||
"completion_ce": 0.9655539393424988
|
||||
},
|
||||
{
|
||||
"capture": "002.npz",
|
||||
"huber": 5.933231830596924,
|
||||
"completion_ce": 1.4181709289550781
|
||||
},
|
||||
{
|
||||
"capture": "003.npz",
|
||||
"huber": 5.828734874725342,
|
||||
"completion_ce": 1.190055251121521
|
||||
},
|
||||
{
|
||||
"capture": "004.npz",
|
||||
"huber": 5.694935321807861,
|
||||
"completion_ce": 0.5248019099235535
|
||||
},
|
||||
{
|
||||
"capture": "005.npz",
|
||||
"huber": 5.623960494995117,
|
||||
"completion_ce": 1.0787538290023804
|
||||
},
|
||||
{
|
||||
"capture": "006.npz",
|
||||
"huber": 5.541686534881592,
|
||||
"completion_ce": 1.3090921640396118
|
||||
},
|
||||
{
|
||||
"capture": "007.npz",
|
||||
"huber": 5.40130615234375,
|
||||
"completion_ce": 0.8813864588737488
|
||||
},
|
||||
{
|
||||
"capture": "008.npz",
|
||||
"huber": 5.236367702484131,
|
||||
"completion_ce": 1.370758056640625
|
||||
},
|
||||
{
|
||||
"capture": "009.npz",
|
||||
"huber": 5.173975467681885,
|
||||
"completion_ce": 1.3936532735824585
|
||||
},
|
||||
{
|
||||
"capture": "010.npz",
|
||||
"huber": 4.974692344665527,
|
||||
"completion_ce": 1.2048746347427368
|
||||
},
|
||||
{
|
||||
"capture": "011.npz",
|
||||
"huber": 4.886224746704102,
|
||||
"completion_ce": 1.0940500497817993
|
||||
},
|
||||
{
|
||||
"capture": "012.npz",
|
||||
"huber": 4.844334125518799,
|
||||
"completion_ce": 1.0000171661376953
|
||||
},
|
||||
{
|
||||
"capture": "013.npz",
|
||||
"huber": 4.717433452606201,
|
||||
"completion_ce": 1.0968774557113647
|
||||
},
|
||||
{
|
||||
"capture": "014.npz",
|
||||
"huber": 4.632009506225586,
|
||||
"completion_ce": 0.6906070709228516
|
||||
},
|
||||
{
|
||||
"capture": "015.npz",
|
||||
"huber": 4.596776485443115,
|
||||
"completion_ce": 0.7141997218132019
|
||||
},
|
||||
{
|
||||
"capture": "016.npz",
|
||||
"huber": 4.485931396484375,
|
||||
"completion_ce": 0.5096238255500793
|
||||
},
|
||||
{
|
||||
"capture": "017.npz",
|
||||
"huber": 4.461272716522217,
|
||||
"completion_ce": 2.0406227111816406
|
||||
},
|
||||
{
|
||||
"capture": "018.npz",
|
||||
"huber": 4.3033037185668945,
|
||||
"completion_ce": 0.6667569279670715
|
||||
},
|
||||
{
|
||||
"capture": "019.npz",
|
||||
"huber": 4.128045558929443,
|
||||
"completion_ce": 0.19051234424114227
|
||||
},
|
||||
{
|
||||
"capture": "020.npz",
|
||||
"huber": 3.950066328048706,
|
||||
"completion_ce": 0.4714221954345703
|
||||
},
|
||||
{
|
||||
"capture": "021.npz",
|
||||
"huber": 3.7163164615631104,
|
||||
"completion_ce": 1.320932388305664
|
||||
},
|
||||
{
|
||||
"capture": "022.npz",
|
||||
"huber": 3.647306442260742,
|
||||
"completion_ce": 0.3110434114933014
|
||||
},
|
||||
{
|
||||
"capture": "023.npz",
|
||||
"huber": 3.464130401611328,
|
||||
"completion_ce": 0.9662138819694519
|
||||
}
|
||||
],
|
||||
"validation": [
|
||||
{
|
||||
"id": "validation-000-0",
|
||||
"task": "lookup",
|
||||
"gold": 44,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "92<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 92,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-000-1",
|
||||
"task": "lookup",
|
||||
"gold": 91,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "92<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 92,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-0",
|
||||
"task": "lookup",
|
||||
"gold": 33,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-1",
|
||||
"task": "lookup",
|
||||
"gold": 28,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-0",
|
||||
"task": "lookup",
|
||||
"gold": 42,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-1",
|
||||
"task": "lookup",
|
||||
"gold": 56,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-0",
|
||||
"task": "lookup",
|
||||
"gold": 93,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
18,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "33<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 33,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-1",
|
||||
"task": "lookup",
|
||||
"gold": 83,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
18,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "33<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 33,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-0",
|
||||
"task": "lookup",
|
||||
"gold": 23,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
17,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "29<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 29,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-1",
|
||||
"task": "lookup",
|
||||
"gold": 89,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-0",
|
||||
"task": "lookup",
|
||||
"gold": 63,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "42<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 42,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-1",
|
||||
"task": "lookup",
|
||||
"gold": 49,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "42<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 42,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-0",
|
||||
"task": "lookup",
|
||||
"gold": 78,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
22,
|
||||
23,
|
||||
248046
|
||||
],
|
||||
"response": "78<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 78,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-1",
|
||||
"task": "lookup",
|
||||
"gold": 29,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
17,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "29<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 29,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-0",
|
||||
"task": "lookup",
|
||||
"gold": 64,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-1",
|
||||
"task": "lookup",
|
||||
"gold": 50,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "43<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 43,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"updates": 48,
|
||||
"validation_correct": [
|
||||
2,
|
||||
2
|
||||
],
|
||||
"selected_epoch": 1,
|
||||
"selected_pairs_both_correct": 0,
|
||||
"corrected_vs_prior": [],
|
||||
"lost_vs_prior": [
|
||||
"validation-000-1",
|
||||
"validation-003-1",
|
||||
"validation-006-0"
|
||||
],
|
||||
"sha256": {
|
||||
"config.json": "ccded2b03b2dc513971b2dc7d4a00d36ec3dcf20c832ea2c5c66ed257493bed3",
|
||||
"trace.json": "f3b998a7bf41bff2ec5265fb151909f46a55f5e346474c1d182fa6769e67d78d",
|
||||
"lisa.pt": "0ba8425d353a10fff867359ffe3445517d0a3699d0d38688d0f424851845a77b"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"diagnostic_correct": {
|
||||
"baseline": 0,
|
||||
"restore-15": 15,
|
||||
"restore-19": 16,
|
||||
"restore-23": 1
|
||||
},
|
||||
"ranks": {
|
||||
"15": 40,
|
||||
"19": 40,
|
||||
"23": 40
|
||||
},
|
||||
"shared": false,
|
||||
"parameters": 2476032,
|
||||
"seed": 621011,
|
||||
"epochs": 2
|
||||
}
|
||||
@@ -0,0 +1,835 @@
|
||||
{
|
||||
"selected_epoch": 1,
|
||||
"epochs": [
|
||||
{
|
||||
"epoch": 1,
|
||||
"steps": [
|
||||
{
|
||||
"capture": "000.npz",
|
||||
"huber": 6.524738311767578,
|
||||
"completion_ce": 3.5905239582061768
|
||||
},
|
||||
{
|
||||
"capture": "001.npz",
|
||||
"huber": 6.487685680389404,
|
||||
"completion_ce": 2.857367753982544
|
||||
},
|
||||
{
|
||||
"capture": "002.npz",
|
||||
"huber": 6.566684246063232,
|
||||
"completion_ce": 2.1398963928222656
|
||||
},
|
||||
{
|
||||
"capture": "003.npz",
|
||||
"huber": 6.537846088409424,
|
||||
"completion_ce": 1.5812244415283203
|
||||
},
|
||||
{
|
||||
"capture": "004.npz",
|
||||
"huber": 6.464921474456787,
|
||||
"completion_ce": 1.6308225393295288
|
||||
},
|
||||
{
|
||||
"capture": "005.npz",
|
||||
"huber": 6.496366024017334,
|
||||
"completion_ce": 1.1146188974380493
|
||||
},
|
||||
{
|
||||
"capture": "006.npz",
|
||||
"huber": 6.503895282745361,
|
||||
"completion_ce": 1.5654563903808594
|
||||
},
|
||||
{
|
||||
"capture": "007.npz",
|
||||
"huber": 6.465696334838867,
|
||||
"completion_ce": 1.1650066375732422
|
||||
},
|
||||
{
|
||||
"capture": "008.npz",
|
||||
"huber": 6.406482219696045,
|
||||
"completion_ce": 1.6461328268051147
|
||||
},
|
||||
{
|
||||
"capture": "009.npz",
|
||||
"huber": 6.459934234619141,
|
||||
"completion_ce": 1.6640383005142212
|
||||
},
|
||||
{
|
||||
"capture": "010.npz",
|
||||
"huber": 6.375650882720947,
|
||||
"completion_ce": 0.7877540588378906
|
||||
},
|
||||
{
|
||||
"capture": "011.npz",
|
||||
"huber": 6.390203952789307,
|
||||
"completion_ce": 1.64840829372406
|
||||
},
|
||||
{
|
||||
"capture": "012.npz",
|
||||
"huber": 6.389590740203857,
|
||||
"completion_ce": 1.9750696420669556
|
||||
},
|
||||
{
|
||||
"capture": "013.npz",
|
||||
"huber": 6.2863383293151855,
|
||||
"completion_ce": 0.8979294896125793
|
||||
},
|
||||
{
|
||||
"capture": "014.npz",
|
||||
"huber": 6.198265552520752,
|
||||
"completion_ce": 0.637627899646759
|
||||
},
|
||||
{
|
||||
"capture": "015.npz",
|
||||
"huber": 6.209751129150391,
|
||||
"completion_ce": 1.4658031463623047
|
||||
},
|
||||
{
|
||||
"capture": "016.npz",
|
||||
"huber": 6.188636779785156,
|
||||
"completion_ce": 0.9911416172981262
|
||||
},
|
||||
{
|
||||
"capture": "017.npz",
|
||||
"huber": 6.192357540130615,
|
||||
"completion_ce": 2.2217273712158203
|
||||
},
|
||||
{
|
||||
"capture": "018.npz",
|
||||
"huber": 6.168215274810791,
|
||||
"completion_ce": 1.8640416860580444
|
||||
},
|
||||
{
|
||||
"capture": "019.npz",
|
||||
"huber": 6.047617435455322,
|
||||
"completion_ce": 0.6252015233039856
|
||||
},
|
||||
{
|
||||
"capture": "020.npz",
|
||||
"huber": 5.998331546783447,
|
||||
"completion_ce": 1.2971197366714478
|
||||
},
|
||||
{
|
||||
"capture": "021.npz",
|
||||
"huber": 5.851507186889648,
|
||||
"completion_ce": 1.5785890817642212
|
||||
},
|
||||
{
|
||||
"capture": "022.npz",
|
||||
"huber": 5.87152624130249,
|
||||
"completion_ce": 1.7713171243667603
|
||||
},
|
||||
{
|
||||
"capture": "023.npz",
|
||||
"huber": 5.775454044342041,
|
||||
"completion_ce": 0.9128805994987488
|
||||
}
|
||||
],
|
||||
"validation": [
|
||||
{
|
||||
"id": "validation-000-0",
|
||||
"task": "lookup",
|
||||
"gold": 44,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "92<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 92,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-000-1",
|
||||
"task": "lookup",
|
||||
"gold": 91,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "92<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 92,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-0",
|
||||
"task": "lookup",
|
||||
"gold": 33,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-1",
|
||||
"task": "lookup",
|
||||
"gold": 28,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-0",
|
||||
"task": "lookup",
|
||||
"gold": 42,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-1",
|
||||
"task": "lookup",
|
||||
"gold": 56,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
21,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "61<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 61,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-0",
|
||||
"task": "lookup",
|
||||
"gold": 93,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-1",
|
||||
"task": "lookup",
|
||||
"gold": 83,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-0",
|
||||
"task": "lookup",
|
||||
"gold": 23,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
23,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "89<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 89,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-1",
|
||||
"task": "lookup",
|
||||
"gold": 89,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
23,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "89<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 89,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-0",
|
||||
"task": "lookup",
|
||||
"gold": 63,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "42<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 42,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-1",
|
||||
"task": "lookup",
|
||||
"gold": 49,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "42<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 42,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-0",
|
||||
"task": "lookup",
|
||||
"gold": 78,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
22,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "79<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 79,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-1",
|
||||
"task": "lookup",
|
||||
"gold": 29,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
22,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "79<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 79,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-0",
|
||||
"task": "lookup",
|
||||
"gold": 64,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-1",
|
||||
"task": "lookup",
|
||||
"gold": 50,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"epoch": 2,
|
||||
"steps": [
|
||||
{
|
||||
"capture": "000.npz",
|
||||
"huber": 5.609214782714844,
|
||||
"completion_ce": 1.3990592956542969
|
||||
},
|
||||
{
|
||||
"capture": "001.npz",
|
||||
"huber": 5.463587284088135,
|
||||
"completion_ce": 0.9291979670524597
|
||||
},
|
||||
{
|
||||
"capture": "002.npz",
|
||||
"huber": 5.410457611083984,
|
||||
"completion_ce": 1.1913553476333618
|
||||
},
|
||||
{
|
||||
"capture": "003.npz",
|
||||
"huber": 5.246613025665283,
|
||||
"completion_ce": 0.9342886805534363
|
||||
},
|
||||
{
|
||||
"capture": "004.npz",
|
||||
"huber": 5.086450576782227,
|
||||
"completion_ce": 0.7399069666862488
|
||||
},
|
||||
{
|
||||
"capture": "005.npz",
|
||||
"huber": 4.98862886428833,
|
||||
"completion_ce": 1.0815563201904297
|
||||
},
|
||||
{
|
||||
"capture": "006.npz",
|
||||
"huber": 4.918123245239258,
|
||||
"completion_ce": 1.208422303199768
|
||||
},
|
||||
{
|
||||
"capture": "007.npz",
|
||||
"huber": 4.818292617797852,
|
||||
"completion_ce": 1.0270391702651978
|
||||
},
|
||||
{
|
||||
"capture": "008.npz",
|
||||
"huber": 4.692378520965576,
|
||||
"completion_ce": 1.0412038564682007
|
||||
},
|
||||
{
|
||||
"capture": "009.npz",
|
||||
"huber": 4.670746803283691,
|
||||
"completion_ce": 1.2291641235351562
|
||||
},
|
||||
{
|
||||
"capture": "010.npz",
|
||||
"huber": 4.519276142120361,
|
||||
"completion_ce": 1.1438089609146118
|
||||
},
|
||||
{
|
||||
"capture": "011.npz",
|
||||
"huber": 4.445656776428223,
|
||||
"completion_ce": 1.9049478769302368
|
||||
},
|
||||
{
|
||||
"capture": "012.npz",
|
||||
"huber": 4.3559441566467285,
|
||||
"completion_ce": 1.7428665161132812
|
||||
},
|
||||
{
|
||||
"capture": "013.npz",
|
||||
"huber": 4.2069196701049805,
|
||||
"completion_ce": 1.2259477376937866
|
||||
},
|
||||
{
|
||||
"capture": "014.npz",
|
||||
"huber": 4.056544780731201,
|
||||
"completion_ce": 1.0597864389419556
|
||||
},
|
||||
{
|
||||
"capture": "015.npz",
|
||||
"huber": 3.9554331302642822,
|
||||
"completion_ce": 1.0544573068618774
|
||||
},
|
||||
{
|
||||
"capture": "016.npz",
|
||||
"huber": 3.802560567855835,
|
||||
"completion_ce": 0.5685660243034363
|
||||
},
|
||||
{
|
||||
"capture": "017.npz",
|
||||
"huber": 3.7663755416870117,
|
||||
"completion_ce": 1.7389545440673828
|
||||
},
|
||||
{
|
||||
"capture": "018.npz",
|
||||
"huber": 3.6362388134002686,
|
||||
"completion_ce": 1.0733699798583984
|
||||
},
|
||||
{
|
||||
"capture": "019.npz",
|
||||
"huber": 3.5059878826141357,
|
||||
"completion_ce": 0.18152809143066406
|
||||
},
|
||||
{
|
||||
"capture": "020.npz",
|
||||
"huber": 3.407637357711792,
|
||||
"completion_ce": 0.6281560063362122
|
||||
},
|
||||
{
|
||||
"capture": "021.npz",
|
||||
"huber": 3.214254379272461,
|
||||
"completion_ce": 1.4416993856430054
|
||||
},
|
||||
{
|
||||
"capture": "022.npz",
|
||||
"huber": 3.1716299057006836,
|
||||
"completion_ce": 0.6806240081787109
|
||||
},
|
||||
{
|
||||
"capture": "023.npz",
|
||||
"huber": 3.040721893310547,
|
||||
"completion_ce": 0.8930473327636719
|
||||
}
|
||||
],
|
||||
"validation": [
|
||||
{
|
||||
"id": "validation-000-0",
|
||||
"task": "lookup",
|
||||
"gold": 44,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "92<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 92,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-000-1",
|
||||
"task": "lookup",
|
||||
"gold": 91,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "92<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 92,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-0",
|
||||
"task": "lookup",
|
||||
"gold": 33,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "49<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 49,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-1",
|
||||
"task": "lookup",
|
||||
"gold": 28,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "49<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 49,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-0",
|
||||
"task": "lookup",
|
||||
"gold": 42,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-1",
|
||||
"task": "lookup",
|
||||
"gold": 56,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
20,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "53<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 53,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-0",
|
||||
"task": "lookup",
|
||||
"gold": 93,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "43<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 43,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-1",
|
||||
"task": "lookup",
|
||||
"gold": 83,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
18,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "33<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 33,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-0",
|
||||
"task": "lookup",
|
||||
"gold": 23,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
17,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "29<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 29,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-1",
|
||||
"task": "lookup",
|
||||
"gold": 89,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-0",
|
||||
"task": "lookup",
|
||||
"gold": 63,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "42<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 42,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-1",
|
||||
"task": "lookup",
|
||||
"gold": 49,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"response": "42<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 42,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-0",
|
||||
"task": "lookup",
|
||||
"gold": 78,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
22,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "79<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 79,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-1",
|
||||
"task": "lookup",
|
||||
"gold": 29,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
18,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "39<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 39,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-0",
|
||||
"task": "lookup",
|
||||
"gold": 64,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-1",
|
||||
"task": "lookup",
|
||||
"gold": 50,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"updates": 48,
|
||||
"validation_correct": [
|
||||
2,
|
||||
0
|
||||
],
|
||||
"selected_epoch": 1,
|
||||
"selected_pairs_both_correct": 0,
|
||||
"corrected_vs_prior": [],
|
||||
"lost_vs_prior": [
|
||||
"validation-000-1",
|
||||
"validation-003-1",
|
||||
"validation-006-0"
|
||||
],
|
||||
"sha256": {
|
||||
"config.json": "fe77bb808f4f0e8649947574788a200af6525cf225923df82425d74463dc0ef3",
|
||||
"trace.json": "b03f68b8300175b82f92ae048e833321e9607f9061b8169b968ef5c4835e93b4",
|
||||
"lisa.pt": "3818a10a7de60d498dc4860b877e8b7d9d9e2bebe1bb6627b442faad2eb85900"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"revision": "15852e8c16360a2fea060d615a32b45270f8a8fc",
|
||||
"inputs": {
|
||||
"manifest.json": "28efbaf94a5034333339a35f08ead151459a7d20c6c2d2f07a451e7f3bf154de",
|
||||
"model_config.json": "ed1c1723241f23f7f4e23430759cbd7dcfb4103cbdfe052bfe7626b57c2615b4",
|
||||
"tokenizer.json": "5f9e4d4901a92b997e463c1f46055088b6cca5ca61a6522d1b9f64c4bb81cb42"
|
||||
},
|
||||
"shards": [
|
||||
{
|
||||
"name": "model.safetensors-00001-of-00001.safetensors",
|
||||
"bytes": 4548221488,
|
||||
"sha256": "aa33250c4fc64891ddfaba3a314fd9542ea371843c387178b425fbcc5ed680b1"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,602 @@
|
||||
{
|
||||
"splits": {
|
||||
"diagnostic": [
|
||||
{
|
||||
"id": "diagnostic-000-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: vine=39, nettle=36, umber=91, quartz=28, larch=76, fern=47, heath=48, iris=82, reed=75, kelp=89, thyme=34, maple=94.\nWhat is the recorded number for larch?",
|
||||
"answer": 76
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-000-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: vine=39, nettle=36, umber=91, quartz=28, larch=75, fern=47, heath=48, iris=82, reed=76, kelp=89, thyme=34, maple=94.\nWhat is the recorded number for larch?",
|
||||
"answer": 75
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-001-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: maple=44, iris=23, fern=88, kelp=77, thyme=73, elm=29, birch=84, umber=76, amber=63, reed=72, quartz=27, yew=39.\nWhat is the recorded number for yew?",
|
||||
"answer": 39
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-001-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: maple=44, iris=23, fern=88, kelp=77, thyme=73, elm=29, birch=84, umber=39, amber=63, reed=72, quartz=27, yew=76.\nWhat is the recorded number for yew?",
|
||||
"answer": 76
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-002-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: iris=25, cedar=56, fern=69, jade=66, nettle=53, yew=78, kelp=67, quartz=31, elm=22, dune=52, amber=84, umber=49.\nWhat is the recorded number for umber?",
|
||||
"answer": 49
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-002-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: iris=25, cedar=56, fern=69, jade=66, nettle=53, yew=78, kelp=67, quartz=31, elm=49, dune=52, amber=84, umber=22.\nWhat is the recorded number for umber?",
|
||||
"answer": 22
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-003-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: fern=73, elm=86, thyme=44, vine=87, dune=75, slate=80, maple=84, larch=90, olive=70, yew=99, reed=63, quartz=21.\nWhat is the recorded number for reed?",
|
||||
"answer": 63
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-003-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: fern=73, elm=86, thyme=44, vine=87, dune=75, slate=80, maple=84, larch=90, olive=70, yew=99, reed=21, quartz=63.\nWhat is the recorded number for reed?",
|
||||
"answer": 21
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-004-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: yew=78, jade=99, maple=84, cedar=88, iris=74, quartz=42, willow=75, dune=89, fern=73, amber=23, reed=29, nettle=47.\nWhat is the recorded number for iris?",
|
||||
"answer": 74
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-004-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: yew=78, jade=99, maple=84, cedar=88, iris=29, quartz=42, willow=75, dune=89, fern=73, amber=23, reed=74, nettle=47.\nWhat is the recorded number for iris?",
|
||||
"answer": 29
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-005-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: dune=25, cedar=24, birch=92, nettle=64, slate=56, olive=69, grove=67, elm=98, willow=39, iris=81, reed=77, fern=48.\nWhat is the recorded number for willow?",
|
||||
"answer": 39
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-005-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: dune=25, cedar=24, birch=92, nettle=64, slate=56, olive=69, grove=67, elm=98, willow=77, iris=81, reed=39, fern=48.\nWhat is the recorded number for willow?",
|
||||
"answer": 77
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-006-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: quartz=35, kelp=51, reed=36, iris=55, vine=67, yew=70, thyme=83, heath=49, nettle=96, cedar=40, amber=31, dune=27.\nWhat is the recorded number for cedar?",
|
||||
"answer": 40
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-006-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: quartz=35, kelp=51, reed=36, iris=55, vine=40, yew=70, thyme=83, heath=49, nettle=96, cedar=67, amber=31, dune=27.\nWhat is the recorded number for cedar?",
|
||||
"answer": 67
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-007-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: umber=48, iris=43, grove=44, maple=73, thyme=89, birch=61, larch=81, amber=93, olive=46, cedar=76, kelp=33, yew=51.\nWhat is the recorded number for thyme?",
|
||||
"answer": 89
|
||||
},
|
||||
{
|
||||
"id": "diagnostic-007-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: umber=48, iris=43, grove=44, maple=73, thyme=61, birch=89, larch=81, amber=93, olive=46, cedar=76, kelp=33, yew=51.\nWhat is the recorded number for thyme?",
|
||||
"answer": 61
|
||||
}
|
||||
],
|
||||
"validation": [
|
||||
{
|
||||
"id": "validation-000-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: kelp=68, dune=98, nettle=92, maple=60, reed=72, birch=74, thyme=91, umber=83, cedar=25, willow=44, grove=79, olive=78.\nWhat is the recorded number for willow?",
|
||||
"answer": 44
|
||||
},
|
||||
{
|
||||
"id": "validation-000-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: kelp=68, dune=98, nettle=92, maple=60, reed=72, birch=74, thyme=44, umber=83, cedar=25, willow=91, grove=79, olive=78.\nWhat is the recorded number for willow?",
|
||||
"answer": 91
|
||||
},
|
||||
{
|
||||
"id": "validation-001-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: vine=46, kelp=91, cedar=72, reed=97, heath=28, pine=48, willow=20, quartz=69, maple=45, elm=22, thyme=33, fern=47.\nWhat is the recorded number for thyme?",
|
||||
"answer": 33
|
||||
},
|
||||
{
|
||||
"id": "validation-001-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: vine=46, kelp=91, cedar=72, reed=97, heath=33, pine=48, willow=20, quartz=69, maple=45, elm=22, thyme=28, fern=47.\nWhat is the recorded number for thyme?",
|
||||
"answer": 28
|
||||
},
|
||||
{
|
||||
"id": "validation-002-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: iris=57, fern=72, elm=56, vine=69, dune=42, yew=51, cedar=71, nettle=93, umber=75, maple=43, slate=22, olive=66.\nWhat is the recorded number for dune?",
|
||||
"answer": 42
|
||||
},
|
||||
{
|
||||
"id": "validation-002-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: iris=57, fern=72, elm=42, vine=69, dune=56, yew=51, cedar=71, nettle=93, umber=75, maple=43, slate=22, olive=66.\nWhat is the recorded number for dune?",
|
||||
"answer": 56
|
||||
},
|
||||
{
|
||||
"id": "validation-003-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: jade=33, quartz=72, slate=34, dune=81, elm=43, willow=95, thyme=83, vine=23, reed=56, fern=48, iris=93, maple=82.\nWhat is the recorded number for iris?",
|
||||
"answer": 93
|
||||
},
|
||||
{
|
||||
"id": "validation-003-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: jade=33, quartz=72, slate=34, dune=81, elm=43, willow=95, thyme=93, vine=23, reed=56, fern=48, iris=83, maple=82.\nWhat is the recorded number for iris?",
|
||||
"answer": 83
|
||||
},
|
||||
{
|
||||
"id": "validation-004-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: fern=70, vine=25, cedar=72, dune=69, olive=23, iris=81, kelp=89, maple=85, quartz=88, jade=32, slate=91, thyme=29.\nWhat is the recorded number for olive?",
|
||||
"answer": 23
|
||||
},
|
||||
{
|
||||
"id": "validation-004-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: fern=70, vine=25, cedar=72, dune=69, olive=89, iris=81, kelp=23, maple=85, quartz=88, jade=32, slate=91, thyme=29.\nWhat is the recorded number for olive?",
|
||||
"answer": 89
|
||||
},
|
||||
{
|
||||
"id": "validation-005-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: willow=60, iris=36, grove=22, thyme=82, pine=74, maple=63, vine=44, yew=62, heath=32, amber=49, slate=96, umber=47.\nWhat is the recorded number for maple?",
|
||||
"answer": 63
|
||||
},
|
||||
{
|
||||
"id": "validation-005-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: willow=60, iris=36, grove=22, thyme=82, pine=74, maple=49, vine=44, yew=62, heath=32, amber=63, slate=96, umber=47.\nWhat is the recorded number for maple?",
|
||||
"answer": 49
|
||||
},
|
||||
{
|
||||
"id": "validation-006-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: pine=32, iris=35, amber=88, heath=48, thyme=77, kelp=78, willow=37, jade=31, grove=97, maple=74, slate=69, umber=29.\nWhat is the recorded number for kelp?",
|
||||
"answer": 78
|
||||
},
|
||||
{
|
||||
"id": "validation-006-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: pine=32, iris=35, amber=88, heath=48, thyme=77, kelp=29, willow=37, jade=31, grove=97, maple=74, slate=69, umber=78.\nWhat is the recorded number for kelp?",
|
||||
"answer": 29
|
||||
},
|
||||
{
|
||||
"id": "validation-007-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: heath=86, grove=50, iris=83, maple=64, reed=95, olive=46, jade=97, umber=24, amber=53, thyme=33, birch=93, pine=96.\nWhat is the recorded number for maple?",
|
||||
"answer": 64
|
||||
},
|
||||
{
|
||||
"id": "validation-007-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: heath=86, grove=64, iris=83, maple=50, reed=95, olive=46, jade=97, umber=24, amber=53, thyme=33, birch=93, pine=96.\nWhat is the recorded number for maple?",
|
||||
"answer": 50
|
||||
}
|
||||
],
|
||||
"test": [
|
||||
{
|
||||
"id": "test-000-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: larch=28, willow=64, thyme=87, dune=51, birch=63, umber=24, olive=72, kelp=97, slate=82, cedar=49, heath=46, nettle=37.\nWhat is the recorded number for nettle?",
|
||||
"answer": 37
|
||||
},
|
||||
{
|
||||
"id": "test-000-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: larch=28, willow=64, thyme=87, dune=51, birch=63, umber=24, olive=72, kelp=97, slate=82, cedar=49, heath=37, nettle=46.\nWhat is the recorded number for nettle?",
|
||||
"answer": 46
|
||||
},
|
||||
{
|
||||
"id": "test-001-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: heath=60, nettle=61, birch=31, cedar=67, umber=88, elm=44, grove=72, amber=78, thyme=48, quartz=33, yew=29, slate=25.\nWhat is the recorded number for cedar?",
|
||||
"answer": 67
|
||||
},
|
||||
{
|
||||
"id": "test-001-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: heath=60, nettle=61, birch=31, cedar=33, umber=88, elm=44, grove=72, amber=78, thyme=48, quartz=67, yew=29, slate=25.\nWhat is the recorded number for cedar?",
|
||||
"answer": 33
|
||||
},
|
||||
{
|
||||
"id": "test-002-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: fern=41, iris=93, heath=36, vine=91, thyme=73, elm=25, reed=83, maple=55, birch=99, grove=35, larch=49, slate=29.\nWhat is the recorded number for grove?",
|
||||
"answer": 35
|
||||
},
|
||||
{
|
||||
"id": "test-002-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: fern=35, iris=93, heath=36, vine=91, thyme=73, elm=25, reed=83, maple=55, birch=99, grove=41, larch=49, slate=29.\nWhat is the recorded number for grove?",
|
||||
"answer": 41
|
||||
},
|
||||
{
|
||||
"id": "test-003-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: slate=59, dune=25, olive=64, nettle=70, grove=89, cedar=76, kelp=54, larch=97, umber=36, amber=71, elm=53, pine=80.\nWhat is the recorded number for umber?",
|
||||
"answer": 36
|
||||
},
|
||||
{
|
||||
"id": "test-003-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: slate=59, dune=25, olive=64, nettle=70, grove=89, cedar=36, kelp=54, larch=97, umber=76, amber=71, elm=53, pine=80.\nWhat is the recorded number for umber?",
|
||||
"answer": 76
|
||||
},
|
||||
{
|
||||
"id": "test-004-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: olive=26, reed=73, yew=37, jade=54, thyme=76, umber=95, cedar=59, slate=52, birch=49, kelp=43, willow=69, pine=63.\nWhat is the recorded number for jade?",
|
||||
"answer": 54
|
||||
},
|
||||
{
|
||||
"id": "test-004-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: olive=26, reed=73, yew=37, jade=52, thyme=76, umber=95, cedar=59, slate=54, birch=49, kelp=43, willow=69, pine=63.\nWhat is the recorded number for jade?",
|
||||
"answer": 52
|
||||
},
|
||||
{
|
||||
"id": "test-005-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: thyme=92, amber=21, larch=31, jade=80, birch=52, willow=99, pine=88, cedar=57, kelp=61, slate=33, nettle=67, quartz=69.\nWhat is the recorded number for amber?",
|
||||
"answer": 21
|
||||
},
|
||||
{
|
||||
"id": "test-005-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: thyme=92, amber=52, larch=31, jade=80, birch=21, willow=99, pine=88, cedar=57, kelp=61, slate=33, nettle=67, quartz=69.\nWhat is the recorded number for amber?",
|
||||
"answer": 52
|
||||
},
|
||||
{
|
||||
"id": "test-006-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: elm=38, yew=66, iris=28, pine=25, quartz=79, willow=49, maple=75, jade=32, umber=96, cedar=86, grove=61, slate=55.\nWhat is the recorded number for jade?",
|
||||
"answer": 32
|
||||
},
|
||||
{
|
||||
"id": "test-006-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: elm=38, yew=66, iris=28, pine=25, quartz=32, willow=49, maple=75, jade=79, umber=96, cedar=86, grove=61, slate=55.\nWhat is the recorded number for jade?",
|
||||
"answer": 79
|
||||
},
|
||||
{
|
||||
"id": "test-007-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: yew=29, maple=50, kelp=83, jade=76, thyme=53, elm=26, reed=90, iris=23, willow=33, quartz=31, cedar=57, grove=49.\nWhat is the recorded number for thyme?",
|
||||
"answer": 53
|
||||
},
|
||||
{
|
||||
"id": "test-007-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: yew=29, maple=50, kelp=83, jade=76, thyme=33, elm=26, reed=90, iris=23, willow=53, quartz=31, cedar=57, grove=49.\nWhat is the recorded number for thyme?",
|
||||
"answer": 33
|
||||
},
|
||||
{
|
||||
"id": "test-008-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: reed=20, willow=26, maple=62, cedar=52, larch=47, kelp=29, slate=84, grove=49, thyme=37, elm=30, olive=66, nettle=58.\nWhat is the recorded number for cedar?",
|
||||
"answer": 52
|
||||
},
|
||||
{
|
||||
"id": "test-008-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: reed=52, willow=26, maple=62, cedar=20, larch=47, kelp=29, slate=84, grove=49, thyme=37, elm=30, olive=66, nettle=58.\nWhat is the recorded number for cedar?",
|
||||
"answer": 20
|
||||
},
|
||||
{
|
||||
"id": "test-009-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: slate=91, iris=23, jade=93, elm=92, maple=99, amber=66, thyme=74, nettle=59, grove=81, olive=67, yew=68, reed=60.\nWhat is the recorded number for maple?",
|
||||
"answer": 99
|
||||
},
|
||||
{
|
||||
"id": "test-009-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: slate=91, iris=23, jade=93, elm=92, maple=74, amber=66, thyme=99, nettle=59, grove=81, olive=67, yew=68, reed=60.\nWhat is the recorded number for maple?",
|
||||
"answer": 74
|
||||
},
|
||||
{
|
||||
"id": "test-010-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: olive=97, heath=37, amber=20, birch=59, larch=58, reed=35, vine=87, kelp=65, thyme=83, cedar=99, dune=96, willow=27.\nWhat is the recorded number for heath?",
|
||||
"answer": 37
|
||||
},
|
||||
{
|
||||
"id": "test-010-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: olive=97, heath=20, amber=37, birch=59, larch=58, reed=35, vine=87, kelp=65, thyme=83, cedar=99, dune=96, willow=27.\nWhat is the recorded number for heath?",
|
||||
"answer": 20
|
||||
},
|
||||
{
|
||||
"id": "test-011-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: reed=37, iris=78, amber=28, grove=38, olive=61, heath=94, birch=55, kelp=99, pine=91, maple=59, willow=36, vine=22.\nWhat is the recorded number for willow?",
|
||||
"answer": 36
|
||||
},
|
||||
{
|
||||
"id": "test-011-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: reed=37, iris=78, amber=28, grove=38, olive=61, heath=94, birch=55, kelp=99, pine=91, maple=36, willow=59, vine=22.\nWhat is the recorded number for willow?",
|
||||
"answer": 59
|
||||
},
|
||||
{
|
||||
"id": "test-012-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: iris=41, reed=70, jade=98, willow=28, slate=34, birch=69, elm=80, nettle=46, pine=33, amber=86, vine=72, kelp=73.\nWhat is the recorded number for jade?",
|
||||
"answer": 98
|
||||
},
|
||||
{
|
||||
"id": "test-012-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: iris=41, reed=70, jade=46, willow=28, slate=34, birch=69, elm=80, nettle=98, pine=33, amber=86, vine=72, kelp=73.\nWhat is the recorded number for jade?",
|
||||
"answer": 46
|
||||
},
|
||||
{
|
||||
"id": "test-013-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: vine=81, olive=56, willow=24, slate=93, elm=82, heath=59, grove=97, fern=57, thyme=78, yew=52, dune=37, umber=23.\nWhat is the recorded number for fern?",
|
||||
"answer": 57
|
||||
},
|
||||
{
|
||||
"id": "test-013-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: vine=81, olive=56, willow=24, slate=57, elm=82, heath=59, grove=97, fern=93, thyme=78, yew=52, dune=37, umber=23.\nWhat is the recorded number for fern?",
|
||||
"answer": 93
|
||||
},
|
||||
{
|
||||
"id": "test-014-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: iris=89, amber=56, cedar=47, slate=31, elm=34, kelp=38, nettle=50, grove=23, fern=90, willow=61, vine=94, heath=68.\nWhat is the recorded number for elm?",
|
||||
"answer": 34
|
||||
},
|
||||
{
|
||||
"id": "test-014-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: iris=89, amber=56, cedar=47, slate=31, elm=94, kelp=38, nettle=50, grove=23, fern=90, willow=61, vine=34, heath=68.\nWhat is the recorded number for elm?",
|
||||
"answer": 94
|
||||
},
|
||||
{
|
||||
"id": "test-015-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: willow=73, thyme=57, amber=49, quartz=58, olive=81, heath=64, fern=93, nettle=74, iris=61, reed=32, yew=35, vine=26.\nWhat is the recorded number for reed?",
|
||||
"answer": 32
|
||||
},
|
||||
{
|
||||
"id": "test-015-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: willow=73, thyme=32, amber=49, quartz=58, olive=81, heath=64, fern=93, nettle=74, iris=61, reed=57, yew=35, vine=26.\nWhat is the recorded number for reed?",
|
||||
"answer": 57
|
||||
},
|
||||
{
|
||||
"id": "test-016-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: nettle=58, willow=62, olive=93, thyme=38, elm=27, cedar=20, birch=86, heath=73, kelp=53, pine=34, dune=50, fern=88.\nWhat is the recorded number for willow?",
|
||||
"answer": 62
|
||||
},
|
||||
{
|
||||
"id": "test-016-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: nettle=58, willow=20, olive=93, thyme=38, elm=27, cedar=62, birch=86, heath=73, kelp=53, pine=34, dune=50, fern=88.\nWhat is the recorded number for willow?",
|
||||
"answer": 20
|
||||
},
|
||||
{
|
||||
"id": "test-017-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: slate=55, reed=97, heath=36, pine=35, grove=70, fern=37, elm=38, nettle=59, thyme=34, larch=47, vine=30, olive=87.\nWhat is the recorded number for grove?",
|
||||
"answer": 70
|
||||
},
|
||||
{
|
||||
"id": "test-017-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: slate=70, reed=97, heath=36, pine=35, grove=55, fern=37, elm=38, nettle=59, thyme=34, larch=47, vine=30, olive=87.\nWhat is the recorded number for grove?",
|
||||
"answer": 55
|
||||
},
|
||||
{
|
||||
"id": "test-018-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: dune=58, umber=27, willow=59, larch=43, nettle=64, jade=50, slate=42, heath=44, cedar=77, reed=85, iris=65, yew=72.\nWhat is the recorded number for yew?",
|
||||
"answer": 72
|
||||
},
|
||||
{
|
||||
"id": "test-018-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: dune=58, umber=27, willow=59, larch=72, nettle=64, jade=50, slate=42, heath=44, cedar=77, reed=85, iris=65, yew=43.\nWhat is the recorded number for yew?",
|
||||
"answer": 43
|
||||
},
|
||||
{
|
||||
"id": "test-019-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: pine=99, slate=58, yew=25, quartz=54, willow=88, vine=40, heath=68, grove=33, elm=32, cedar=80, fern=98, jade=85.\nWhat is the recorded number for fern?",
|
||||
"answer": 98
|
||||
},
|
||||
{
|
||||
"id": "test-019-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: pine=99, slate=58, yew=25, quartz=54, willow=88, vine=40, heath=68, grove=33, elm=32, cedar=80, fern=85, jade=98.\nWhat is the recorded number for fern?",
|
||||
"answer": 85
|
||||
},
|
||||
{
|
||||
"id": "test-020-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: amber=80, umber=98, dune=50, maple=90, slate=41, pine=57, birch=74, elm=27, quartz=66, larch=61, iris=35, kelp=49.\nWhat is the recorded number for iris?",
|
||||
"answer": 35
|
||||
},
|
||||
{
|
||||
"id": "test-020-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: amber=80, umber=98, dune=50, maple=90, slate=35, pine=57, birch=74, elm=27, quartz=66, larch=61, iris=41, kelp=49.\nWhat is the recorded number for iris?",
|
||||
"answer": 41
|
||||
},
|
||||
{
|
||||
"id": "test-021-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: fern=74, olive=20, elm=37, kelp=33, slate=86, iris=99, quartz=61, yew=39, jade=21, pine=50, amber=64, thyme=73.\nWhat is the recorded number for elm?",
|
||||
"answer": 37
|
||||
},
|
||||
{
|
||||
"id": "test-021-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: fern=74, olive=20, elm=64, kelp=33, slate=86, iris=99, quartz=61, yew=39, jade=21, pine=50, amber=37, thyme=73.\nWhat is the recorded number for elm?",
|
||||
"answer": 64
|
||||
},
|
||||
{
|
||||
"id": "test-022-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: dune=48, reed=49, birch=31, jade=83, thyme=72, willow=50, heath=54, pine=39, slate=56, nettle=26, vine=22, grove=57.\nWhat is the recorded number for heath?",
|
||||
"answer": 54
|
||||
},
|
||||
{
|
||||
"id": "test-022-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: dune=48, reed=49, birch=31, jade=83, thyme=72, willow=50, heath=56, pine=39, slate=54, nettle=26, vine=22, grove=57.\nWhat is the recorded number for heath?",
|
||||
"answer": 56
|
||||
},
|
||||
{
|
||||
"id": "test-023-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: thyme=82, vine=61, jade=68, quartz=93, cedar=76, grove=59, willow=67, fern=65, amber=38, dune=29, maple=37, slate=21.\nWhat is the recorded number for fern?",
|
||||
"answer": 65
|
||||
},
|
||||
{
|
||||
"id": "test-023-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: thyme=82, vine=61, jade=68, quartz=93, cedar=76, grove=59, willow=67, fern=29, amber=38, dune=65, maple=37, slate=21.\nWhat is the recorded number for fern?",
|
||||
"answer": 29
|
||||
},
|
||||
{
|
||||
"id": "test-024-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: fern=27, elm=39, willow=90, heath=36, slate=61, grove=85, vine=67, birch=56, cedar=47, iris=93, kelp=54, thyme=84.\nWhat is the recorded number for thyme?",
|
||||
"answer": 84
|
||||
},
|
||||
{
|
||||
"id": "test-024-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: fern=27, elm=39, willow=90, heath=84, slate=61, grove=85, vine=67, birch=56, cedar=47, iris=93, kelp=54, thyme=36.\nWhat is the recorded number for thyme?",
|
||||
"answer": 36
|
||||
},
|
||||
{
|
||||
"id": "test-025-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: heath=41, quartz=66, reed=48, willow=47, fern=44, slate=40, pine=52, grove=90, nettle=33, maple=23, larch=92, olive=55.\nWhat is the recorded number for maple?",
|
||||
"answer": 23
|
||||
},
|
||||
{
|
||||
"id": "test-025-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: heath=41, quartz=66, reed=48, willow=47, fern=23, slate=40, pine=52, grove=90, nettle=33, maple=44, larch=92, olive=55.\nWhat is the recorded number for maple?",
|
||||
"answer": 44
|
||||
},
|
||||
{
|
||||
"id": "test-026-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: thyme=30, olive=71, quartz=40, cedar=37, larch=55, amber=90, maple=74, grove=21, pine=23, birch=70, jade=89, slate=43.\nWhat is the recorded number for maple?",
|
||||
"answer": 74
|
||||
},
|
||||
{
|
||||
"id": "test-026-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: thyme=30, olive=71, quartz=40, cedar=37, larch=55, amber=90, maple=70, grove=21, pine=23, birch=74, jade=89, slate=43.\nWhat is the recorded number for maple?",
|
||||
"answer": 70
|
||||
},
|
||||
{
|
||||
"id": "test-027-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: heath=84, yew=47, amber=48, reed=91, elm=79, grove=99, fern=95, kelp=90, olive=29, dune=39, maple=92, vine=98.\nWhat is the recorded number for heath?",
|
||||
"answer": 84
|
||||
},
|
||||
{
|
||||
"id": "test-027-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: heath=39, yew=47, amber=48, reed=91, elm=79, grove=99, fern=95, kelp=90, olive=29, dune=84, maple=92, vine=98.\nWhat is the recorded number for heath?",
|
||||
"answer": 39
|
||||
},
|
||||
{
|
||||
"id": "test-028-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: slate=79, umber=50, heath=41, larch=87, elm=48, yew=51, willow=45, olive=53, fern=60, cedar=27, kelp=68, reed=30.\nWhat is the recorded number for slate?",
|
||||
"answer": 79
|
||||
},
|
||||
{
|
||||
"id": "test-028-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: slate=68, umber=50, heath=41, larch=87, elm=48, yew=51, willow=45, olive=53, fern=60, cedar=27, kelp=79, reed=30.\nWhat is the recorded number for slate?",
|
||||
"answer": 68
|
||||
},
|
||||
{
|
||||
"id": "test-029-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: maple=24, elm=41, amber=60, willow=78, quartz=20, thyme=28, olive=92, vine=23, fern=72, iris=33, umber=47, pine=66.\nWhat is the recorded number for quartz?",
|
||||
"answer": 20
|
||||
},
|
||||
{
|
||||
"id": "test-029-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: maple=24, elm=41, amber=60, willow=20, quartz=78, thyme=28, olive=92, vine=23, fern=72, iris=33, umber=47, pine=66.\nWhat is the recorded number for quartz?",
|
||||
"answer": 78
|
||||
},
|
||||
{
|
||||
"id": "test-030-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: grove=47, fern=45, elm=26, amber=22, quartz=86, reed=78, birch=29, cedar=74, willow=99, slate=52, larch=58, maple=55.\nWhat is the recorded number for fern?",
|
||||
"answer": 45
|
||||
},
|
||||
{
|
||||
"id": "test-030-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: grove=47, fern=74, elm=26, amber=22, quartz=86, reed=78, birch=29, cedar=45, willow=99, slate=52, larch=58, maple=55.\nWhat is the recorded number for fern?",
|
||||
"answer": 74
|
||||
},
|
||||
{
|
||||
"id": "test-031-0",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: heath=50, jade=46, birch=70, larch=99, dune=78, nettle=49, umber=38, vine=60, amber=28, grove=69, olive=58, kelp=92.\nWhat is the recorded number for kelp?",
|
||||
"answer": 92
|
||||
},
|
||||
{
|
||||
"id": "test-031-1",
|
||||
"task": "lookup",
|
||||
"question": "Records in time order: heath=50, jade=46, birch=92, larch=99, dune=78, nettle=49, umber=38, vine=60, amber=28, grove=69, olive=58, kelp=70.\nWhat is the recorded number for kelp?",
|
||||
"answer": 70
|
||||
}
|
||||
]
|
||||
},
|
||||
"base_adapter": "c82db5af7fa42cf58a349f3e53961da2360b211a7ed606f53a728860c64f6f29",
|
||||
"sites": [
|
||||
15,
|
||||
19,
|
||||
23
|
||||
],
|
||||
"rank_budget": [
|
||||
32,
|
||||
40,
|
||||
48
|
||||
],
|
||||
"uniform_rank": 40,
|
||||
"cap": 24,
|
||||
"rank_selection": "Order layers by increase in complete-answer correct count upon single restoration; ties by ascending layer index, earlier gets higher rank.",
|
||||
"primary_metric": "complete answer accuracy; paired uncertainty resamples counterfactual pairs",
|
||||
"secondary_metric": "both members of pair correct"
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"seed": 621011,
|
||||
"parameters": 2476032,
|
||||
"diagnostic_scores": {
|
||||
"baseline": 0,
|
||||
"restore-15": 15,
|
||||
"restore-19": 16,
|
||||
"restore-23": 1
|
||||
},
|
||||
"ranks": {
|
||||
"allocated": {
|
||||
"19": 48,
|
||||
"15": 40,
|
||||
"23": 32
|
||||
},
|
||||
"reversed": {
|
||||
"19": 32,
|
||||
"15": 40,
|
||||
"23": 48
|
||||
},
|
||||
"uniform": {
|
||||
"15": 40,
|
||||
"19": 40,
|
||||
"23": 40
|
||||
}
|
||||
},
|
||||
"initial_state_by_layer_sha256": {
|
||||
"shared-allocated": {
|
||||
"15": "9af9d1b0a03933874ac6bca5b42337d0a569d5649d0f5a3b210ee229c475d2fe",
|
||||
"19": "3b5f0f486671233b03f16cfa973eddbfbb4851a2f2027ecbe222bc24439e074a",
|
||||
"23": "639d755d4d403c688c887e56f01dc3f45ba0fe2733cdce2ea9dff5ce8f7de204"
|
||||
},
|
||||
"shared-uniform": {
|
||||
"15": "9af9d1b0a03933874ac6bca5b42337d0a569d5649d0f5a3b210ee229c475d2fe",
|
||||
"19": "4f3db2093ff2360e651ff62a938d45d1a8af3c3115c7bde81bf2dee49ca8f2a4",
|
||||
"23": "f4308bfa4436812592db5e799db3fe5cd5f1d5908bfd1a8cbf1718801436ef44"
|
||||
},
|
||||
"shared-reversed": {
|
||||
"15": "9af9d1b0a03933874ac6bca5b42337d0a569d5649d0f5a3b210ee229c475d2fe",
|
||||
"19": "e852591d89c30c8d367b3d3de8c5182fcdd3bd76b9f4e13d962faad4c8c975df",
|
||||
"23": "c1d7b72136e328821614f4e28e1e0287567df65459d80302537e2085c1777800"
|
||||
},
|
||||
"local-uniform": {
|
||||
"15": "9af9d1b0a03933874ac6bca5b42337d0a569d5649d0f5a3b210ee229c475d2fe",
|
||||
"19": "4f3db2093ff2360e651ff62a938d45d1a8af3c3115c7bde81bf2dee49ca8f2a4",
|
||||
"23": "f4308bfa4436812592db5e799db3fe5cd5f1d5908bfd1a8cbf1718801436ef44"
|
||||
},
|
||||
"local-allocated": {
|
||||
"15": "9af9d1b0a03933874ac6bca5b42337d0a569d5649d0f5a3b210ee229c475d2fe",
|
||||
"19": "3b5f0f486671233b03f16cfa973eddbfbb4851a2f2027ecbe222bc24439e074a",
|
||||
"23": "639d755d4d403c688c887e56f01dc3f45ba0fe2733cdce2ea9dff5ce8f7de204"
|
||||
}
|
||||
},
|
||||
"digest_encoding": "Sorted state_dict names per layer. For each tensor: compact JSON [name,dtype,shape], newline, contiguous native tensor bytes (little endian)."
|
||||
}
|
||||
@@ -0,0 +1,336 @@
|
||||
{
|
||||
"split": "validation",
|
||||
"questions": 16,
|
||||
"pairs": 8,
|
||||
"planned_rank_conditions": [
|
||||
"shared-allocated",
|
||||
"shared-uniform",
|
||||
"shared-reversed",
|
||||
"local-uniform",
|
||||
"local-allocated"
|
||||
],
|
||||
"completed_rank_conditions": 5,
|
||||
"prior_pairs_with_changed_answers": [
|
||||
"validation-003",
|
||||
"validation-006"
|
||||
],
|
||||
"selected_models": {
|
||||
"shared-allocated": {
|
||||
"validation_correct_by_epoch": [
|
||||
2,
|
||||
3
|
||||
],
|
||||
"selected_epoch": 2,
|
||||
"selected_correct": 3,
|
||||
"selected_pairs_both_correct": 0,
|
||||
"pairs_with_changed_answers": [
|
||||
"validation-004",
|
||||
"validation-005",
|
||||
"validation-006"
|
||||
],
|
||||
"versus_prior": {
|
||||
"corrected": [],
|
||||
"lost": [
|
||||
"validation-003-0",
|
||||
"validation-003-1"
|
||||
],
|
||||
"net": -2,
|
||||
"same_token_streams": 12
|
||||
}
|
||||
},
|
||||
"shared-uniform": {
|
||||
"validation_correct_by_epoch": [
|
||||
3,
|
||||
5
|
||||
],
|
||||
"selected_epoch": 2,
|
||||
"selected_correct": 5,
|
||||
"selected_pairs_both_correct": 1,
|
||||
"pairs_with_changed_answers": [
|
||||
"validation-003",
|
||||
"validation-006"
|
||||
],
|
||||
"versus_prior": {
|
||||
"corrected": [],
|
||||
"lost": [],
|
||||
"net": 0,
|
||||
"same_token_streams": 16
|
||||
}
|
||||
},
|
||||
"shared-reversed": {
|
||||
"validation_correct_by_epoch": [
|
||||
4,
|
||||
4
|
||||
],
|
||||
"selected_epoch": 1,
|
||||
"selected_correct": 4,
|
||||
"selected_pairs_both_correct": 1,
|
||||
"pairs_with_changed_answers": [
|
||||
"validation-002",
|
||||
"validation-003"
|
||||
],
|
||||
"versus_prior": {
|
||||
"corrected": [],
|
||||
"lost": [
|
||||
"validation-006-0"
|
||||
],
|
||||
"net": -1,
|
||||
"same_token_streams": 11
|
||||
}
|
||||
},
|
||||
"local-uniform": {
|
||||
"validation_correct_by_epoch": [
|
||||
2,
|
||||
0
|
||||
],
|
||||
"selected_epoch": 1,
|
||||
"selected_correct": 2,
|
||||
"selected_pairs_both_correct": 0,
|
||||
"pairs_with_changed_answers": [
|
||||
"validation-002"
|
||||
],
|
||||
"versus_prior": {
|
||||
"corrected": [],
|
||||
"lost": [
|
||||
"validation-000-1",
|
||||
"validation-003-1",
|
||||
"validation-006-0"
|
||||
],
|
||||
"net": -3,
|
||||
"same_token_streams": 6
|
||||
}
|
||||
},
|
||||
"local-allocated": {
|
||||
"validation_correct_by_epoch": [
|
||||
2,
|
||||
2
|
||||
],
|
||||
"selected_epoch": 1,
|
||||
"selected_correct": 2,
|
||||
"selected_pairs_both_correct": 0,
|
||||
"pairs_with_changed_answers": [
|
||||
"validation-007"
|
||||
],
|
||||
"versus_prior": {
|
||||
"corrected": [],
|
||||
"lost": [
|
||||
"validation-000-1",
|
||||
"validation-003-1",
|
||||
"validation-006-0"
|
||||
],
|
||||
"net": -3,
|
||||
"same_token_streams": 6
|
||||
}
|
||||
}
|
||||
},
|
||||
"comparisons": {
|
||||
"shared-allocated-vs-shared-uniform": {
|
||||
"selected": {
|
||||
"corrected": [],
|
||||
"lost": [
|
||||
"validation-003-0",
|
||||
"validation-003-1"
|
||||
],
|
||||
"net": -2,
|
||||
"same_token_streams": 12
|
||||
},
|
||||
"at_same_epoch": [
|
||||
{
|
||||
"corrected": [],
|
||||
"lost": [
|
||||
"validation-005-1"
|
||||
],
|
||||
"net": -1,
|
||||
"same_token_streams": 13
|
||||
},
|
||||
{
|
||||
"corrected": [],
|
||||
"lost": [
|
||||
"validation-003-0",
|
||||
"validation-003-1"
|
||||
],
|
||||
"net": -2,
|
||||
"same_token_streams": 12
|
||||
}
|
||||
]
|
||||
},
|
||||
"shared-allocated-vs-shared-reversed": {
|
||||
"selected": {
|
||||
"corrected": [
|
||||
"validation-006-0"
|
||||
],
|
||||
"lost": [
|
||||
"validation-003-0",
|
||||
"validation-003-1"
|
||||
],
|
||||
"net": -1,
|
||||
"same_token_streams": 7
|
||||
},
|
||||
"at_same_epoch": [
|
||||
{
|
||||
"corrected": [],
|
||||
"lost": [
|
||||
"validation-003-1",
|
||||
"validation-004-1"
|
||||
],
|
||||
"net": -2,
|
||||
"same_token_streams": 12
|
||||
},
|
||||
{
|
||||
"corrected": [],
|
||||
"lost": [
|
||||
"validation-006-1"
|
||||
],
|
||||
"net": -1,
|
||||
"same_token_streams": 13
|
||||
}
|
||||
]
|
||||
},
|
||||
"shared-allocated-vs-local-allocated": {
|
||||
"selected": {
|
||||
"corrected": [
|
||||
"validation-000-1",
|
||||
"validation-006-0"
|
||||
],
|
||||
"lost": [
|
||||
"validation-003-0"
|
||||
],
|
||||
"net": 1,
|
||||
"same_token_streams": 4
|
||||
},
|
||||
"at_same_epoch": [
|
||||
{
|
||||
"corrected": [
|
||||
"validation-000-1"
|
||||
],
|
||||
"lost": [
|
||||
"validation-004-1"
|
||||
],
|
||||
"net": 0,
|
||||
"same_token_streams": 5
|
||||
},
|
||||
{
|
||||
"corrected": [
|
||||
"validation-000-1",
|
||||
"validation-004-1"
|
||||
],
|
||||
"lost": [
|
||||
"validation-006-1"
|
||||
],
|
||||
"net": 1,
|
||||
"same_token_streams": 7
|
||||
}
|
||||
]
|
||||
},
|
||||
"shared-reversed-vs-shared-uniform": {
|
||||
"selected": {
|
||||
"corrected": [],
|
||||
"lost": [
|
||||
"validation-006-0"
|
||||
],
|
||||
"net": -1,
|
||||
"same_token_streams": 11
|
||||
},
|
||||
"at_same_epoch": [
|
||||
{
|
||||
"corrected": [
|
||||
"validation-003-1",
|
||||
"validation-004-1"
|
||||
],
|
||||
"lost": [
|
||||
"validation-005-1"
|
||||
],
|
||||
"net": 1,
|
||||
"same_token_streams": 10
|
||||
},
|
||||
{
|
||||
"corrected": [
|
||||
"validation-006-1"
|
||||
],
|
||||
"lost": [
|
||||
"validation-003-0",
|
||||
"validation-003-1"
|
||||
],
|
||||
"net": -1,
|
||||
"same_token_streams": 11
|
||||
}
|
||||
]
|
||||
},
|
||||
"local-allocated-vs-local-uniform": {
|
||||
"selected": {
|
||||
"corrected": [],
|
||||
"lost": [],
|
||||
"net": 0,
|
||||
"same_token_streams": 14
|
||||
},
|
||||
"at_same_epoch": [
|
||||
{
|
||||
"corrected": [],
|
||||
"lost": [],
|
||||
"net": 0,
|
||||
"same_token_streams": 14
|
||||
},
|
||||
{
|
||||
"corrected": [
|
||||
"validation-006-0",
|
||||
"validation-006-1"
|
||||
],
|
||||
"lost": [],
|
||||
"net": 2,
|
||||
"same_token_streams": 9
|
||||
}
|
||||
]
|
||||
},
|
||||
"shared-uniform-vs-local-uniform": {
|
||||
"selected": {
|
||||
"corrected": [
|
||||
"validation-000-1",
|
||||
"validation-003-1",
|
||||
"validation-006-0"
|
||||
],
|
||||
"lost": [],
|
||||
"net": 3,
|
||||
"same_token_streams": 6
|
||||
},
|
||||
"at_same_epoch": [
|
||||
{
|
||||
"corrected": [
|
||||
"validation-000-1",
|
||||
"validation-005-1"
|
||||
],
|
||||
"lost": [
|
||||
"validation-004-1"
|
||||
],
|
||||
"net": 1,
|
||||
"same_token_streams": 5
|
||||
},
|
||||
{
|
||||
"corrected": [
|
||||
"validation-000-1",
|
||||
"validation-003-0",
|
||||
"validation-003-1",
|
||||
"validation-004-1",
|
||||
"validation-006-0"
|
||||
],
|
||||
"lost": [],
|
||||
"net": 5,
|
||||
"same_token_streams": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"question_ids_with_a_correct_candidate_answer": {
|
||||
"allocated_or_student": [
|
||||
"validation-000-1",
|
||||
"validation-004-1",
|
||||
"validation-006-0"
|
||||
],
|
||||
"allocated_or_student_or_prior": [
|
||||
"validation-000-1",
|
||||
"validation-003-0",
|
||||
"validation-003-1",
|
||||
"validation-004-1",
|
||||
"validation-006-0"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"diagnostic_correct": {
|
||||
"baseline": 0,
|
||||
"restore-15": 15,
|
||||
"restore-19": 16,
|
||||
"restore-23": 1
|
||||
},
|
||||
"ranks": {
|
||||
"19": 48,
|
||||
"15": 40,
|
||||
"23": 32
|
||||
},
|
||||
"shared": true,
|
||||
"parameters": 2476032,
|
||||
"seed": 621011,
|
||||
"epochs": 2
|
||||
}
|
||||
@@ -0,0 +1,835 @@
|
||||
{
|
||||
"selected_epoch": 2,
|
||||
"epochs": [
|
||||
{
|
||||
"epoch": 1,
|
||||
"steps": [
|
||||
{
|
||||
"capture": "000.npz",
|
||||
"huber": 6.484985828399658,
|
||||
"completion_ce": 3.689948320388794
|
||||
},
|
||||
{
|
||||
"capture": "001.npz",
|
||||
"huber": 6.435533046722412,
|
||||
"completion_ce": 2.815239667892456
|
||||
},
|
||||
{
|
||||
"capture": "002.npz",
|
||||
"huber": 6.501165866851807,
|
||||
"completion_ce": 2.2910900115966797
|
||||
},
|
||||
{
|
||||
"capture": "003.npz",
|
||||
"huber": 6.459116458892822,
|
||||
"completion_ce": 1.4170297384262085
|
||||
},
|
||||
{
|
||||
"capture": "004.npz",
|
||||
"huber": 6.366516590118408,
|
||||
"completion_ce": 1.6510658264160156
|
||||
},
|
||||
{
|
||||
"capture": "005.npz",
|
||||
"huber": 6.376306533813477,
|
||||
"completion_ce": 1.031119704246521
|
||||
},
|
||||
{
|
||||
"capture": "006.npz",
|
||||
"huber": 6.363456726074219,
|
||||
"completion_ce": 1.2906379699707031
|
||||
},
|
||||
{
|
||||
"capture": "007.npz",
|
||||
"huber": 6.301973819732666,
|
||||
"completion_ce": 1.2287101745605469
|
||||
},
|
||||
{
|
||||
"capture": "008.npz",
|
||||
"huber": 6.219982147216797,
|
||||
"completion_ce": 1.8168309926986694
|
||||
},
|
||||
{
|
||||
"capture": "009.npz",
|
||||
"huber": 6.2503790855407715,
|
||||
"completion_ce": 1.3349508047103882
|
||||
},
|
||||
{
|
||||
"capture": "010.npz",
|
||||
"huber": 6.146358013153076,
|
||||
"completion_ce": 0.8580843806266785
|
||||
},
|
||||
{
|
||||
"capture": "011.npz",
|
||||
"huber": 6.143476963043213,
|
||||
"completion_ce": 1.3071588277816772
|
||||
},
|
||||
{
|
||||
"capture": "012.npz",
|
||||
"huber": 6.126444339752197,
|
||||
"completion_ce": 1.2763277292251587
|
||||
},
|
||||
{
|
||||
"capture": "013.npz",
|
||||
"huber": 6.020519733428955,
|
||||
"completion_ce": 0.9891433715820312
|
||||
},
|
||||
{
|
||||
"capture": "014.npz",
|
||||
"huber": 5.930761337280273,
|
||||
"completion_ce": 0.878393828868866
|
||||
},
|
||||
{
|
||||
"capture": "015.npz",
|
||||
"huber": 5.9369354248046875,
|
||||
"completion_ce": 1.1470876932144165
|
||||
},
|
||||
{
|
||||
"capture": "016.npz",
|
||||
"huber": 5.919126987457275,
|
||||
"completion_ce": 0.3603922426700592
|
||||
},
|
||||
{
|
||||
"capture": "017.npz",
|
||||
"huber": 5.926023483276367,
|
||||
"completion_ce": 2.0578842163085938
|
||||
},
|
||||
{
|
||||
"capture": "018.npz",
|
||||
"huber": 5.8985443115234375,
|
||||
"completion_ce": 1.4073950052261353
|
||||
},
|
||||
{
|
||||
"capture": "019.npz",
|
||||
"huber": 5.787118434906006,
|
||||
"completion_ce": 0.5757427215576172
|
||||
},
|
||||
{
|
||||
"capture": "020.npz",
|
||||
"huber": 5.741567611694336,
|
||||
"completion_ce": 0.9653084874153137
|
||||
},
|
||||
{
|
||||
"capture": "021.npz",
|
||||
"huber": 5.615768909454346,
|
||||
"completion_ce": 1.2124963998794556
|
||||
},
|
||||
{
|
||||
"capture": "022.npz",
|
||||
"huber": 5.636579990386963,
|
||||
"completion_ce": 1.0802103281021118
|
||||
},
|
||||
{
|
||||
"capture": "023.npz",
|
||||
"huber": 5.545068264007568,
|
||||
"completion_ce": 1.0685577392578125
|
||||
}
|
||||
],
|
||||
"validation": [
|
||||
{
|
||||
"id": "validation-000-0",
|
||||
"task": "lookup",
|
||||
"gold": 44,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-000-1",
|
||||
"task": "lookup",
|
||||
"gold": 91,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-0",
|
||||
"task": "lookup",
|
||||
"gold": 33,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "97<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 97,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-1",
|
||||
"task": "lookup",
|
||||
"gold": 28,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "97<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 97,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-0",
|
||||
"task": "lookup",
|
||||
"gold": 42,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-1",
|
||||
"task": "lookup",
|
||||
"gold": 56,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-0",
|
||||
"task": "lookup",
|
||||
"gold": 93,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-1",
|
||||
"task": "lookup",
|
||||
"gold": 83,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-0",
|
||||
"task": "lookup",
|
||||
"gold": 23,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
17,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "29<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 29,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-1",
|
||||
"task": "lookup",
|
||||
"gold": 89,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-0",
|
||||
"task": "lookup",
|
||||
"gold": 63,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"response": "44<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 44,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-1",
|
||||
"task": "lookup",
|
||||
"gold": 49,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"response": "44<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 44,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-0",
|
||||
"task": "lookup",
|
||||
"gold": 78,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "97<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 97,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-1",
|
||||
"task": "lookup",
|
||||
"gold": 29,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "97<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 97,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-0",
|
||||
"task": "lookup",
|
||||
"gold": 64,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-1",
|
||||
"task": "lookup",
|
||||
"gold": 50,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"epoch": 2,
|
||||
"steps": [
|
||||
{
|
||||
"capture": "000.npz",
|
||||
"huber": 5.412282943725586,
|
||||
"completion_ce": 1.240404725074768
|
||||
},
|
||||
{
|
||||
"capture": "001.npz",
|
||||
"huber": 5.291560173034668,
|
||||
"completion_ce": 0.4346771240234375
|
||||
},
|
||||
{
|
||||
"capture": "002.npz",
|
||||
"huber": 5.254405975341797,
|
||||
"completion_ce": 1.4337667226791382
|
||||
},
|
||||
{
|
||||
"capture": "003.npz",
|
||||
"huber": 5.112814426422119,
|
||||
"completion_ce": 0.49626222252845764
|
||||
},
|
||||
{
|
||||
"capture": "004.npz",
|
||||
"huber": 4.9319281578063965,
|
||||
"completion_ce": 0.5854136347770691
|
||||
},
|
||||
{
|
||||
"capture": "005.npz",
|
||||
"huber": 4.811761379241943,
|
||||
"completion_ce": 0.5730641484260559
|
||||
},
|
||||
{
|
||||
"capture": "006.npz",
|
||||
"huber": 4.663804054260254,
|
||||
"completion_ce": 1.0617586374282837
|
||||
},
|
||||
{
|
||||
"capture": "007.npz",
|
||||
"huber": 4.466916561126709,
|
||||
"completion_ce": 0.34136962890625
|
||||
},
|
||||
{
|
||||
"capture": "008.npz",
|
||||
"huber": 4.245267868041992,
|
||||
"completion_ce": 0.9211139678955078
|
||||
},
|
||||
{
|
||||
"capture": "009.npz",
|
||||
"huber": 4.138031959533691,
|
||||
"completion_ce": 0.912613570690155
|
||||
},
|
||||
{
|
||||
"capture": "010.npz",
|
||||
"huber": 3.917837142944336,
|
||||
"completion_ce": 0.7355403900146484
|
||||
},
|
||||
{
|
||||
"capture": "011.npz",
|
||||
"huber": 3.8383302688598633,
|
||||
"completion_ce": 0.86811763048172
|
||||
},
|
||||
{
|
||||
"capture": "012.npz",
|
||||
"huber": 3.793792486190796,
|
||||
"completion_ce": 0.525964081287384
|
||||
},
|
||||
{
|
||||
"capture": "013.npz",
|
||||
"huber": 3.7311267852783203,
|
||||
"completion_ce": 0.6477171778678894
|
||||
},
|
||||
{
|
||||
"capture": "014.npz",
|
||||
"huber": 3.660640001296997,
|
||||
"completion_ce": 0.3576374053955078
|
||||
},
|
||||
{
|
||||
"capture": "015.npz",
|
||||
"huber": 3.590545415878296,
|
||||
"completion_ce": 0.42681822180747986
|
||||
},
|
||||
{
|
||||
"capture": "016.npz",
|
||||
"huber": 3.478916883468628,
|
||||
"completion_ce": 0.2565886080265045
|
||||
},
|
||||
{
|
||||
"capture": "017.npz",
|
||||
"huber": 3.4254138469696045,
|
||||
"completion_ce": 1.4864343404769897
|
||||
},
|
||||
{
|
||||
"capture": "018.npz",
|
||||
"huber": 3.2207138538360596,
|
||||
"completion_ce": 0.25919023156166077
|
||||
},
|
||||
{
|
||||
"capture": "019.npz",
|
||||
"huber": 3.0474510192871094,
|
||||
"completion_ce": 0.08626111596822739
|
||||
},
|
||||
{
|
||||
"capture": "020.npz",
|
||||
"huber": 2.88421893119812,
|
||||
"completion_ce": 0.09066835790872574
|
||||
},
|
||||
{
|
||||
"capture": "021.npz",
|
||||
"huber": 2.696475028991699,
|
||||
"completion_ce": 0.09523773193359375
|
||||
},
|
||||
{
|
||||
"capture": "022.npz",
|
||||
"huber": 2.649243116378784,
|
||||
"completion_ce": 0.6278018951416016
|
||||
},
|
||||
{
|
||||
"capture": "023.npz",
|
||||
"huber": 2.5207579135894775,
|
||||
"completion_ce": 0.4561271667480469
|
||||
}
|
||||
],
|
||||
"validation": [
|
||||
{
|
||||
"id": "validation-000-0",
|
||||
"task": "lookup",
|
||||
"gold": 44,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-000-1",
|
||||
"task": "lookup",
|
||||
"gold": 91,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-0",
|
||||
"task": "lookup",
|
||||
"gold": 33,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "47<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 47,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-1",
|
||||
"task": "lookup",
|
||||
"gold": 28,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "47<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 47,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-0",
|
||||
"task": "lookup",
|
||||
"gold": 42,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-1",
|
||||
"task": "lookup",
|
||||
"gold": 56,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-0",
|
||||
"task": "lookup",
|
||||
"gold": 93,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
18,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "33<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 33,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-1",
|
||||
"task": "lookup",
|
||||
"gold": 83,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
18,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "33<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 33,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-0",
|
||||
"task": "lookup",
|
||||
"gold": 23,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
17,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "29<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 29,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-1",
|
||||
"task": "lookup",
|
||||
"gold": 89,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
23,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "89<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 89,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-0",
|
||||
"task": "lookup",
|
||||
"gold": 63,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "49<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 49,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-1",
|
||||
"task": "lookup",
|
||||
"gold": 49,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"response": "44<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 44,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-0",
|
||||
"task": "lookup",
|
||||
"gold": 78,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
22,
|
||||
23,
|
||||
248046
|
||||
],
|
||||
"response": "78<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 78,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-1",
|
||||
"task": "lookup",
|
||||
"gold": 29,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
22,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"response": "74<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 74,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-0",
|
||||
"task": "lookup",
|
||||
"gold": 64,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-1",
|
||||
"task": "lookup",
|
||||
"gold": 50,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"updates": 48,
|
||||
"validation_correct": [
|
||||
2,
|
||||
3
|
||||
],
|
||||
"selected_epoch": 2,
|
||||
"selected_pairs_both_correct": 0,
|
||||
"corrected_vs_prior": [],
|
||||
"lost_vs_prior": [
|
||||
"validation-003-0",
|
||||
"validation-003-1"
|
||||
],
|
||||
"sha256": {
|
||||
"config.json": "fb6392312500cbfd043b59f374a1605a50e50537fe7e7c5ce1f93e81d956cc10",
|
||||
"trace.json": "5b2cc6113d00d4c9af92de29605127c5f7a2ad4d1e0b58300cc78639a5167db2",
|
||||
"lisa.pt": "f77ab651298bb59af17d43bdf7a2bb9102b8f90ee45db2d8f8fd579c2557e31b"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"diagnostic_correct": {
|
||||
"baseline": 0,
|
||||
"restore-15": 15,
|
||||
"restore-19": 16,
|
||||
"restore-23": 1
|
||||
},
|
||||
"ranks": {
|
||||
"19": 32,
|
||||
"15": 40,
|
||||
"23": 48
|
||||
},
|
||||
"shared": true,
|
||||
"parameters": 2476032,
|
||||
"seed": 621011,
|
||||
"epochs": 2
|
||||
}
|
||||
@@ -0,0 +1,835 @@
|
||||
{
|
||||
"selected_epoch": 1,
|
||||
"epochs": [
|
||||
{
|
||||
"epoch": 1,
|
||||
"steps": [
|
||||
{
|
||||
"capture": "000.npz",
|
||||
"huber": 6.47969388961792,
|
||||
"completion_ce": 3.6952648162841797
|
||||
},
|
||||
{
|
||||
"capture": "001.npz",
|
||||
"huber": 6.433418273925781,
|
||||
"completion_ce": 2.676237106323242
|
||||
},
|
||||
{
|
||||
"capture": "002.npz",
|
||||
"huber": 6.505581378936768,
|
||||
"completion_ce": 1.9741026163101196
|
||||
},
|
||||
{
|
||||
"capture": "003.npz",
|
||||
"huber": 6.463381290435791,
|
||||
"completion_ce": 1.5257009267807007
|
||||
},
|
||||
{
|
||||
"capture": "004.npz",
|
||||
"huber": 6.373131275177002,
|
||||
"completion_ce": 1.7907238006591797
|
||||
},
|
||||
{
|
||||
"capture": "005.npz",
|
||||
"huber": 6.388526916503906,
|
||||
"completion_ce": 1.0882892608642578
|
||||
},
|
||||
{
|
||||
"capture": "006.npz",
|
||||
"huber": 6.378331661224365,
|
||||
"completion_ce": 1.3282362222671509
|
||||
},
|
||||
{
|
||||
"capture": "007.npz",
|
||||
"huber": 6.317391872406006,
|
||||
"completion_ce": 1.0422242879867554
|
||||
},
|
||||
{
|
||||
"capture": "008.npz",
|
||||
"huber": 6.234086990356445,
|
||||
"completion_ce": 1.7206891775131226
|
||||
},
|
||||
{
|
||||
"capture": "009.npz",
|
||||
"huber": 6.262031078338623,
|
||||
"completion_ce": 1.2720800638198853
|
||||
},
|
||||
{
|
||||
"capture": "010.npz",
|
||||
"huber": 6.153445720672607,
|
||||
"completion_ce": 0.7246456146240234
|
||||
},
|
||||
{
|
||||
"capture": "011.npz",
|
||||
"huber": 6.139883041381836,
|
||||
"completion_ce": 1.0487226247787476
|
||||
},
|
||||
{
|
||||
"capture": "012.npz",
|
||||
"huber": 6.108192443847656,
|
||||
"completion_ce": 1.0792375802993774
|
||||
},
|
||||
{
|
||||
"capture": "013.npz",
|
||||
"huber": 5.982972621917725,
|
||||
"completion_ce": 0.9067853093147278
|
||||
},
|
||||
{
|
||||
"capture": "014.npz",
|
||||
"huber": 5.865071773529053,
|
||||
"completion_ce": 0.6609084010124207
|
||||
},
|
||||
{
|
||||
"capture": "015.npz",
|
||||
"huber": 5.840371608734131,
|
||||
"completion_ce": 0.9531771540641785
|
||||
},
|
||||
{
|
||||
"capture": "016.npz",
|
||||
"huber": 5.775660037994385,
|
||||
"completion_ce": 0.3432655334472656
|
||||
},
|
||||
{
|
||||
"capture": "017.npz",
|
||||
"huber": 5.726261138916016,
|
||||
"completion_ce": 1.5925140380859375
|
||||
},
|
||||
{
|
||||
"capture": "018.npz",
|
||||
"huber": 5.634014129638672,
|
||||
"completion_ce": 1.4231586456298828
|
||||
},
|
||||
{
|
||||
"capture": "019.npz",
|
||||
"huber": 5.442501544952393,
|
||||
"completion_ce": 0.6525261998176575
|
||||
},
|
||||
{
|
||||
"capture": "020.npz",
|
||||
"huber": 5.312092304229736,
|
||||
"completion_ce": 1.0116742849349976
|
||||
},
|
||||
{
|
||||
"capture": "021.npz",
|
||||
"huber": 5.079554557800293,
|
||||
"completion_ce": 0.8966090083122253
|
||||
},
|
||||
{
|
||||
"capture": "022.npz",
|
||||
"huber": 4.9882283210754395,
|
||||
"completion_ce": 1.2070471048355103
|
||||
},
|
||||
{
|
||||
"capture": "023.npz",
|
||||
"huber": 4.818462371826172,
|
||||
"completion_ce": 1.0657628774642944
|
||||
}
|
||||
],
|
||||
"validation": [
|
||||
{
|
||||
"id": "validation-000-0",
|
||||
"task": "lookup",
|
||||
"gold": 44,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-000-1",
|
||||
"task": "lookup",
|
||||
"gold": 91,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-0",
|
||||
"task": "lookup",
|
||||
"gold": 33,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "97<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 97,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-1",
|
||||
"task": "lookup",
|
||||
"gold": 28,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "97<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 97,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-0",
|
||||
"task": "lookup",
|
||||
"gold": 42,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-1",
|
||||
"task": "lookup",
|
||||
"gold": 56,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
21,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "61<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 61,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-0",
|
||||
"task": "lookup",
|
||||
"gold": 93,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-1",
|
||||
"task": "lookup",
|
||||
"gold": 83,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
23,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "83<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 83,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-0",
|
||||
"task": "lookup",
|
||||
"gold": 23,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
23,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "89<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 89,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-1",
|
||||
"task": "lookup",
|
||||
"gold": 89,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
23,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "89<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 89,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-0",
|
||||
"task": "lookup",
|
||||
"gold": 63,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"response": "44<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 44,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-1",
|
||||
"task": "lookup",
|
||||
"gold": 49,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"response": "44<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 44,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-0",
|
||||
"task": "lookup",
|
||||
"gold": 78,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "97<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 97,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-1",
|
||||
"task": "lookup",
|
||||
"gold": 29,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "97<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 97,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-0",
|
||||
"task": "lookup",
|
||||
"gold": 64,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-1",
|
||||
"task": "lookup",
|
||||
"gold": 50,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"epoch": 2,
|
||||
"steps": [
|
||||
{
|
||||
"capture": "000.npz",
|
||||
"huber": 4.6193623542785645,
|
||||
"completion_ce": 0.8577277064323425
|
||||
},
|
||||
{
|
||||
"capture": "001.npz",
|
||||
"huber": 4.506784915924072,
|
||||
"completion_ce": 0.6525923609733582
|
||||
},
|
||||
{
|
||||
"capture": "002.npz",
|
||||
"huber": 4.516745090484619,
|
||||
"completion_ce": 1.6954269409179688
|
||||
},
|
||||
{
|
||||
"capture": "003.npz",
|
||||
"huber": 4.484735488891602,
|
||||
"completion_ce": 0.5060698390007019
|
||||
},
|
||||
{
|
||||
"capture": "004.npz",
|
||||
"huber": 4.461283206939697,
|
||||
"completion_ce": 0.7141463160514832
|
||||
},
|
||||
{
|
||||
"capture": "005.npz",
|
||||
"huber": 4.481112957000732,
|
||||
"completion_ce": 0.5248101353645325
|
||||
},
|
||||
{
|
||||
"capture": "006.npz",
|
||||
"huber": 4.454598903656006,
|
||||
"completion_ce": 0.9919026494026184
|
||||
},
|
||||
{
|
||||
"capture": "007.npz",
|
||||
"huber": 4.397470474243164,
|
||||
"completion_ce": 0.5766086578369141
|
||||
},
|
||||
{
|
||||
"capture": "008.npz",
|
||||
"huber": 4.272283554077148,
|
||||
"completion_ce": 0.8157730102539062
|
||||
},
|
||||
{
|
||||
"capture": "009.npz",
|
||||
"huber": 4.207197189331055,
|
||||
"completion_ce": 0.6416066288948059
|
||||
},
|
||||
{
|
||||
"capture": "010.npz",
|
||||
"huber": 4.060182094573975,
|
||||
"completion_ce": 0.4246279299259186
|
||||
},
|
||||
{
|
||||
"capture": "011.npz",
|
||||
"huber": 3.9883720874786377,
|
||||
"completion_ce": 1.02548086643219
|
||||
},
|
||||
{
|
||||
"capture": "012.npz",
|
||||
"huber": 3.9563169479370117,
|
||||
"completion_ce": 0.3400198519229889
|
||||
},
|
||||
{
|
||||
"capture": "013.npz",
|
||||
"huber": 3.8881824016571045,
|
||||
"completion_ce": 0.3332939147949219
|
||||
},
|
||||
{
|
||||
"capture": "014.npz",
|
||||
"huber": 3.8299522399902344,
|
||||
"completion_ce": 0.27632203698158264
|
||||
},
|
||||
{
|
||||
"capture": "015.npz",
|
||||
"huber": 3.8505141735076904,
|
||||
"completion_ce": 0.6081180572509766
|
||||
},
|
||||
{
|
||||
"capture": "016.npz",
|
||||
"huber": 3.8458311557769775,
|
||||
"completion_ce": 0.21047909557819366
|
||||
},
|
||||
{
|
||||
"capture": "017.npz",
|
||||
"huber": 3.8426876068115234,
|
||||
"completion_ce": 2.173872709274292
|
||||
},
|
||||
{
|
||||
"capture": "018.npz",
|
||||
"huber": 3.8103654384613037,
|
||||
"completion_ce": 0.34080567955970764
|
||||
},
|
||||
{
|
||||
"capture": "019.npz",
|
||||
"huber": 3.6913068294525146,
|
||||
"completion_ce": 0.1316121369600296
|
||||
},
|
||||
{
|
||||
"capture": "020.npz",
|
||||
"huber": 3.6542205810546875,
|
||||
"completion_ce": 0.1006011962890625
|
||||
},
|
||||
{
|
||||
"capture": "021.npz",
|
||||
"huber": 3.5423583984375,
|
||||
"completion_ce": 0.1395467072725296
|
||||
},
|
||||
{
|
||||
"capture": "022.npz",
|
||||
"huber": 3.5827243328094482,
|
||||
"completion_ce": 0.32173410058021545
|
||||
},
|
||||
{
|
||||
"capture": "023.npz",
|
||||
"huber": 3.5425472259521484,
|
||||
"completion_ce": 0.32767486572265625
|
||||
}
|
||||
],
|
||||
"validation": [
|
||||
{
|
||||
"id": "validation-000-0",
|
||||
"task": "lookup",
|
||||
"gold": 44,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-000-1",
|
||||
"task": "lookup",
|
||||
"gold": 91,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-0",
|
||||
"task": "lookup",
|
||||
"gold": 33,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "47<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 47,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-1",
|
||||
"task": "lookup",
|
||||
"gold": 28,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "47<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 47,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-0",
|
||||
"task": "lookup",
|
||||
"gold": 42,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-1",
|
||||
"task": "lookup",
|
||||
"gold": 56,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-0",
|
||||
"task": "lookup",
|
||||
"gold": 93,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
18,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "33<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 33,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-1",
|
||||
"task": "lookup",
|
||||
"gold": 83,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
18,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "33<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 33,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-0",
|
||||
"task": "lookup",
|
||||
"gold": 23,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
17,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "29<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 29,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-1",
|
||||
"task": "lookup",
|
||||
"gold": 89,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
23,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "89<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 89,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-0",
|
||||
"task": "lookup",
|
||||
"gold": 63,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"response": "44<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 44,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-1",
|
||||
"task": "lookup",
|
||||
"gold": 49,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"response": "44<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 44,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-0",
|
||||
"task": "lookup",
|
||||
"gold": 78,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
22,
|
||||
23,
|
||||
248046
|
||||
],
|
||||
"response": "78<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 78,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-1",
|
||||
"task": "lookup",
|
||||
"gold": 29,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
17,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "29<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 29,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-0",
|
||||
"task": "lookup",
|
||||
"gold": 64,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-1",
|
||||
"task": "lookup",
|
||||
"gold": 50,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
18,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "33<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 33,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"updates": 48,
|
||||
"validation_correct": [
|
||||
4,
|
||||
4
|
||||
],
|
||||
"selected_epoch": 1,
|
||||
"selected_pairs_both_correct": 1,
|
||||
"corrected_vs_prior": [],
|
||||
"lost_vs_prior": [
|
||||
"validation-006-0"
|
||||
],
|
||||
"sha256": {
|
||||
"config.json": "10a531e7532a2684a694e4e9df14f3cf0a5b6c3874b1b37659b1a8b16913a60d",
|
||||
"trace.json": "e01bee4fd9d19427663731c71bd65f332fea1c3d56935f8968f12e51075eb309",
|
||||
"lisa.pt": "478213fc412b70a1ef0bfed735d22950dfc1bff396bff36b771a2d235849ff1d"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"diagnostic_correct": {
|
||||
"baseline": 0,
|
||||
"restore-15": 15,
|
||||
"restore-19": 16,
|
||||
"restore-23": 1
|
||||
},
|
||||
"ranks": {
|
||||
"15": 40,
|
||||
"19": 40,
|
||||
"23": 40
|
||||
},
|
||||
"shared": true,
|
||||
"parameters": 2476032,
|
||||
"seed": 621011,
|
||||
"epochs": 2
|
||||
}
|
||||
@@ -0,0 +1,835 @@
|
||||
{
|
||||
"selected_epoch": 2,
|
||||
"epochs": [
|
||||
{
|
||||
"epoch": 1,
|
||||
"steps": [
|
||||
{
|
||||
"capture": "000.npz",
|
||||
"huber": 6.466125965118408,
|
||||
"completion_ce": 3.640169858932495
|
||||
},
|
||||
{
|
||||
"capture": "001.npz",
|
||||
"huber": 6.416173458099365,
|
||||
"completion_ce": 2.7350101470947266
|
||||
},
|
||||
{
|
||||
"capture": "002.npz",
|
||||
"huber": 6.482085704803467,
|
||||
"completion_ce": 2.03899884223938
|
||||
},
|
||||
{
|
||||
"capture": "003.npz",
|
||||
"huber": 6.430853366851807,
|
||||
"completion_ce": 1.5210151672363281
|
||||
},
|
||||
{
|
||||
"capture": "004.npz",
|
||||
"huber": 6.329977512359619,
|
||||
"completion_ce": 1.6759847402572632
|
||||
},
|
||||
{
|
||||
"capture": "005.npz",
|
||||
"huber": 6.335151195526123,
|
||||
"completion_ce": 1.0699304342269897
|
||||
},
|
||||
{
|
||||
"capture": "006.npz",
|
||||
"huber": 6.317526340484619,
|
||||
"completion_ce": 1.4101346731185913
|
||||
},
|
||||
{
|
||||
"capture": "007.npz",
|
||||
"huber": 6.251140594482422,
|
||||
"completion_ce": 1.1468429565429688
|
||||
},
|
||||
{
|
||||
"capture": "008.npz",
|
||||
"huber": 6.1668524742126465,
|
||||
"completion_ce": 1.6777559518814087
|
||||
},
|
||||
{
|
||||
"capture": "009.npz",
|
||||
"huber": 6.1963043212890625,
|
||||
"completion_ce": 1.2596086263656616
|
||||
},
|
||||
{
|
||||
"capture": "010.npz",
|
||||
"huber": 6.088558673858643,
|
||||
"completion_ce": 0.6729698181152344
|
||||
},
|
||||
{
|
||||
"capture": "011.npz",
|
||||
"huber": 6.079294681549072,
|
||||
"completion_ce": 1.2998491525650024
|
||||
},
|
||||
{
|
||||
"capture": "012.npz",
|
||||
"huber": 6.054551601409912,
|
||||
"completion_ce": 1.4103832244873047
|
||||
},
|
||||
{
|
||||
"capture": "013.npz",
|
||||
"huber": 5.936060428619385,
|
||||
"completion_ce": 1.0076059103012085
|
||||
},
|
||||
{
|
||||
"capture": "014.npz",
|
||||
"huber": 5.830902576446533,
|
||||
"completion_ce": 0.8567708134651184
|
||||
},
|
||||
{
|
||||
"capture": "015.npz",
|
||||
"huber": 5.81991720199585,
|
||||
"completion_ce": 0.9816989898681641
|
||||
},
|
||||
{
|
||||
"capture": "016.npz",
|
||||
"huber": 5.782172679901123,
|
||||
"completion_ce": 0.32713380455970764
|
||||
},
|
||||
{
|
||||
"capture": "017.npz",
|
||||
"huber": 5.763124465942383,
|
||||
"completion_ce": 2.0601158142089844
|
||||
},
|
||||
{
|
||||
"capture": "018.npz",
|
||||
"huber": 5.706521511077881,
|
||||
"completion_ce": 1.5579833984375
|
||||
},
|
||||
{
|
||||
"capture": "019.npz",
|
||||
"huber": 5.558866500854492,
|
||||
"completion_ce": 0.44708251953125
|
||||
},
|
||||
{
|
||||
"capture": "020.npz",
|
||||
"huber": 5.477881908416748,
|
||||
"completion_ce": 1.1636791229248047
|
||||
},
|
||||
{
|
||||
"capture": "021.npz",
|
||||
"huber": 5.311099529266357,
|
||||
"completion_ce": 1.1208223104476929
|
||||
},
|
||||
{
|
||||
"capture": "022.npz",
|
||||
"huber": 5.279181957244873,
|
||||
"completion_ce": 1.268227219581604
|
||||
},
|
||||
{
|
||||
"capture": "023.npz",
|
||||
"huber": 5.142008304595947,
|
||||
"completion_ce": 0.9710490107536316
|
||||
}
|
||||
],
|
||||
"validation": [
|
||||
{
|
||||
"id": "validation-000-0",
|
||||
"task": "lookup",
|
||||
"gold": 44,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-000-1",
|
||||
"task": "lookup",
|
||||
"gold": 91,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-0",
|
||||
"task": "lookup",
|
||||
"gold": 33,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "97<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 97,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-1",
|
||||
"task": "lookup",
|
||||
"gold": 28,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "97<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 97,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-0",
|
||||
"task": "lookup",
|
||||
"gold": 42,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-1",
|
||||
"task": "lookup",
|
||||
"gold": 56,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-0",
|
||||
"task": "lookup",
|
||||
"gold": 93,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-1",
|
||||
"task": "lookup",
|
||||
"gold": 83,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-0",
|
||||
"task": "lookup",
|
||||
"gold": 23,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-1",
|
||||
"task": "lookup",
|
||||
"gold": 89,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-0",
|
||||
"task": "lookup",
|
||||
"gold": 63,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "49<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 49,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-1",
|
||||
"task": "lookup",
|
||||
"gold": 49,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "49<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 49,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-0",
|
||||
"task": "lookup",
|
||||
"gold": 78,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "97<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 97,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-1",
|
||||
"task": "lookup",
|
||||
"gold": 29,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "97<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 97,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-0",
|
||||
"task": "lookup",
|
||||
"gold": 64,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-1",
|
||||
"task": "lookup",
|
||||
"gold": 50,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"epoch": 2,
|
||||
"steps": [
|
||||
{
|
||||
"capture": "000.npz",
|
||||
"huber": 4.952552318572998,
|
||||
"completion_ce": 1.4009037017822266
|
||||
},
|
||||
{
|
||||
"capture": "001.npz",
|
||||
"huber": 4.789427280426025,
|
||||
"completion_ce": 0.5592880249023438
|
||||
},
|
||||
{
|
||||
"capture": "002.npz",
|
||||
"huber": 4.726945400238037,
|
||||
"completion_ce": 1.2972265481948853
|
||||
},
|
||||
{
|
||||
"capture": "003.npz",
|
||||
"huber": 4.5856170654296875,
|
||||
"completion_ce": 0.5974127650260925
|
||||
},
|
||||
{
|
||||
"capture": "004.npz",
|
||||
"huber": 4.457610607147217,
|
||||
"completion_ce": 0.4448140561580658
|
||||
},
|
||||
{
|
||||
"capture": "005.npz",
|
||||
"huber": 4.406347274780273,
|
||||
"completion_ce": 0.6005427241325378
|
||||
},
|
||||
{
|
||||
"capture": "006.npz",
|
||||
"huber": 4.3611578941345215,
|
||||
"completion_ce": 1.11090087890625
|
||||
},
|
||||
{
|
||||
"capture": "007.npz",
|
||||
"huber": 4.287736415863037,
|
||||
"completion_ce": 0.4663238525390625
|
||||
},
|
||||
{
|
||||
"capture": "008.npz",
|
||||
"huber": 4.187578201293945,
|
||||
"completion_ce": 1.04208242893219
|
||||
},
|
||||
{
|
||||
"capture": "009.npz",
|
||||
"huber": 4.137438774108887,
|
||||
"completion_ce": 0.754715621471405
|
||||
},
|
||||
{
|
||||
"capture": "010.npz",
|
||||
"huber": 3.979546308517456,
|
||||
"completion_ce": 0.5380516052246094
|
||||
},
|
||||
{
|
||||
"capture": "011.npz",
|
||||
"huber": 3.8709640502929688,
|
||||
"completion_ce": 0.7800388336181641
|
||||
},
|
||||
{
|
||||
"capture": "012.npz",
|
||||
"huber": 3.749253273010254,
|
||||
"completion_ce": 0.5718275904655457
|
||||
},
|
||||
{
|
||||
"capture": "013.npz",
|
||||
"huber": 3.5951597690582275,
|
||||
"completion_ce": 0.8369833827018738
|
||||
},
|
||||
{
|
||||
"capture": "014.npz",
|
||||
"huber": 3.4549624919891357,
|
||||
"completion_ce": 0.37712350487709045
|
||||
},
|
||||
{
|
||||
"capture": "015.npz",
|
||||
"huber": 3.3932430744171143,
|
||||
"completion_ce": 0.47049713134765625
|
||||
},
|
||||
{
|
||||
"capture": "016.npz",
|
||||
"huber": 3.3298141956329346,
|
||||
"completion_ce": 0.24415016174316406
|
||||
},
|
||||
{
|
||||
"capture": "017.npz",
|
||||
"huber": 3.315248727798462,
|
||||
"completion_ce": 1.5147151947021484
|
||||
},
|
||||
{
|
||||
"capture": "018.npz",
|
||||
"huber": 3.2439496517181396,
|
||||
"completion_ce": 0.15868441760540009
|
||||
},
|
||||
{
|
||||
"capture": "019.npz",
|
||||
"huber": 3.1188666820526123,
|
||||
"completion_ce": 0.05583127215504646
|
||||
},
|
||||
{
|
||||
"capture": "020.npz",
|
||||
"huber": 3.04500412940979,
|
||||
"completion_ce": 0.022246679291129112
|
||||
},
|
||||
{
|
||||
"capture": "021.npz",
|
||||
"huber": 2.903524160385132,
|
||||
"completion_ce": 0.07955551147460938
|
||||
},
|
||||
{
|
||||
"capture": "022.npz",
|
||||
"huber": 2.9015865325927734,
|
||||
"completion_ce": 1.1182270050048828
|
||||
},
|
||||
{
|
||||
"capture": "023.npz",
|
||||
"huber": 2.8223178386688232,
|
||||
"completion_ce": 0.44306373596191406
|
||||
}
|
||||
],
|
||||
"validation": [
|
||||
{
|
||||
"id": "validation-000-0",
|
||||
"task": "lookup",
|
||||
"gold": 44,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-000-1",
|
||||
"task": "lookup",
|
||||
"gold": 91,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-0",
|
||||
"task": "lookup",
|
||||
"gold": 33,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "47<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 47,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-1",
|
||||
"task": "lookup",
|
||||
"gold": 28,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "47<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 47,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-0",
|
||||
"task": "lookup",
|
||||
"gold": 42,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-1",
|
||||
"task": "lookup",
|
||||
"gold": 56,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-0",
|
||||
"task": "lookup",
|
||||
"gold": 93,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-1",
|
||||
"task": "lookup",
|
||||
"gold": 83,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
23,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "83<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 83,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-0",
|
||||
"task": "lookup",
|
||||
"gold": 23,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
23,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "89<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 89,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-1",
|
||||
"task": "lookup",
|
||||
"gold": 89,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
23,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "89<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 89,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-0",
|
||||
"task": "lookup",
|
||||
"gold": 63,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"response": "44<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 44,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-1",
|
||||
"task": "lookup",
|
||||
"gold": 49,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
19,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"response": "44<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 44,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-0",
|
||||
"task": "lookup",
|
||||
"gold": 78,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
22,
|
||||
23,
|
||||
248046
|
||||
],
|
||||
"response": "78<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 78,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-1",
|
||||
"task": "lookup",
|
||||
"gold": 29,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
22,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"response": "74<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 74,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-0",
|
||||
"task": "lookup",
|
||||
"gold": 64,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-1",
|
||||
"task": "lookup",
|
||||
"gold": 50,
|
||||
"arms": {
|
||||
"lisa": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"updates": 48,
|
||||
"validation_correct": [
|
||||
3,
|
||||
5
|
||||
],
|
||||
"selected_epoch": 2,
|
||||
"selected_pairs_both_correct": 1,
|
||||
"corrected_vs_prior": [],
|
||||
"lost_vs_prior": [],
|
||||
"matches_prior_48_fit_loss_records": true,
|
||||
"selected_tensors_match_prior": true,
|
||||
"sha256": {
|
||||
"config.json": "59b9f4c954269294a59ca40227a9fcd69f6a591e9a023f01a2cad4f51bcd15bb",
|
||||
"trace.json": "34be3c67e5c82aed4bfdd6bdd17ac8bf8b6efb830faa08c7373dc3af03936d52",
|
||||
"lisa.pt": "c82db5af7fa42cf58a349f3e53961da2360b211a7ed606f53a728860c64f6f29"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"qualified_validation_prefixes": [],
|
||||
"test_evaluated": false
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"spec": {
|
||||
"protocol_sha256": "6858dbc64db0b989e8112e9dbea70662a2a05f66f11b180e8f2c668c74c43aef",
|
||||
"base_sha256": "c82db5af7fa42cf58a349f3e53961da2360b211a7ed606f53a728860c64f6f29",
|
||||
"fraction": 0.5,
|
||||
"parameters": 2476032,
|
||||
"endpoints": {
|
||||
"student": {
|
||||
"trained_sha256": "7faacdffbc81d0c786ef0c7a5acaf1724d82af155fed7b834dabc73dcf91f3a4",
|
||||
"midpoint_sha256": "d0cf6b4ad1b4791dcaa4ebf50eb623f16260249996fe810ee8f0905dedb8a335"
|
||||
},
|
||||
"reference": {
|
||||
"trained_sha256": "21ae007cb7343c1a0042655824bdc98ee2f03071d5f5dc43dbc8b441a262d84f",
|
||||
"midpoint_sha256": "e0e2c61fcaecb591631a66889c838d351c1bf5a608638c05622a20487d8de324"
|
||||
}
|
||||
}
|
||||
},
|
||||
"independent_checks": {
|
||||
"student": {
|
||||
"tensors_checked": 12,
|
||||
"parameters_checked": 2476032,
|
||||
"update_l2_ratio": 0.49999999981533333
|
||||
},
|
||||
"reference": {
|
||||
"tensors_checked": 12,
|
||||
"parameters_checked": 2476032,
|
||||
"update_l2_ratio": 0.5000000004162759
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"protocol_sha256": "6858dbc64db0b989e8112e9dbea70662a2a05f66f11b180e8f2c668c74c43aef",
|
||||
"base_sha256": "c82db5af7fa42cf58a349f3e53961da2360b211a7ed606f53a728860c64f6f29",
|
||||
"fraction": 0.5,
|
||||
"parameters": 2476032,
|
||||
"endpoints": {
|
||||
"student": {
|
||||
"trained_sha256": "7faacdffbc81d0c786ef0c7a5acaf1724d82af155fed7b834dabc73dcf91f3a4",
|
||||
"midpoint_sha256": "d0cf6b4ad1b4791dcaa4ebf50eb623f16260249996fe810ee8f0905dedb8a335"
|
||||
},
|
||||
"reference": {
|
||||
"trained_sha256": "21ae007cb7343c1a0042655824bdc98ee2f03071d5f5dc43dbc8b441a262d84f",
|
||||
"midpoint_sha256": "e0e2c61fcaecb591631a66889c838d351c1bf5a608638c05622a20487d8de324"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,290 @@
|
||||
[
|
||||
{
|
||||
"id": "validation-000-0",
|
||||
"task": "lookup",
|
||||
"gold": 44,
|
||||
"arms": {
|
||||
"half-reference": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-000-1",
|
||||
"task": "lookup",
|
||||
"gold": 91,
|
||||
"arms": {
|
||||
"half-reference": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-0",
|
||||
"task": "lookup",
|
||||
"gold": 33,
|
||||
"arms": {
|
||||
"half-reference": {
|
||||
"tokens": [
|
||||
19,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "47<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 47,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-1",
|
||||
"task": "lookup",
|
||||
"gold": 28,
|
||||
"arms": {
|
||||
"half-reference": {
|
||||
"tokens": [
|
||||
19,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "47<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 47,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-0",
|
||||
"task": "lookup",
|
||||
"gold": 42,
|
||||
"arms": {
|
||||
"half-reference": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-1",
|
||||
"task": "lookup",
|
||||
"gold": 56,
|
||||
"arms": {
|
||||
"half-reference": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-0",
|
||||
"task": "lookup",
|
||||
"gold": 93,
|
||||
"arms": {
|
||||
"half-reference": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-1",
|
||||
"task": "lookup",
|
||||
"gold": 83,
|
||||
"arms": {
|
||||
"half-reference": {
|
||||
"tokens": [
|
||||
19,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "43<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 43,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-0",
|
||||
"task": "lookup",
|
||||
"gold": 23,
|
||||
"arms": {
|
||||
"half-reference": {
|
||||
"tokens": [
|
||||
23,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "89<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 89,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-1",
|
||||
"task": "lookup",
|
||||
"gold": 89,
|
||||
"arms": {
|
||||
"half-reference": {
|
||||
"tokens": [
|
||||
23,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "89<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 89,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-0",
|
||||
"task": "lookup",
|
||||
"gold": 63,
|
||||
"arms": {
|
||||
"half-reference": {
|
||||
"tokens": [
|
||||
19,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"response": "44<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 44,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-1",
|
||||
"task": "lookup",
|
||||
"gold": 49,
|
||||
"arms": {
|
||||
"half-reference": {
|
||||
"tokens": [
|
||||
19,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"response": "44<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 44,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-0",
|
||||
"task": "lookup",
|
||||
"gold": 78,
|
||||
"arms": {
|
||||
"half-reference": {
|
||||
"tokens": [
|
||||
22,
|
||||
23,
|
||||
248046
|
||||
],
|
||||
"response": "78<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 78,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-1",
|
||||
"task": "lookup",
|
||||
"gold": 29,
|
||||
"arms": {
|
||||
"half-reference": {
|
||||
"tokens": [
|
||||
18,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "31<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 31,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-0",
|
||||
"task": "lookup",
|
||||
"gold": 64,
|
||||
"arms": {
|
||||
"half-reference": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-1",
|
||||
"task": "lookup",
|
||||
"gold": 50,
|
||||
"arms": {
|
||||
"half-reference": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,290 @@
|
||||
[
|
||||
{
|
||||
"id": "validation-000-0",
|
||||
"task": "lookup",
|
||||
"gold": 44,
|
||||
"arms": {
|
||||
"half-student": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-000-1",
|
||||
"task": "lookup",
|
||||
"gold": 91,
|
||||
"arms": {
|
||||
"half-student": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-0",
|
||||
"task": "lookup",
|
||||
"gold": 33,
|
||||
"arms": {
|
||||
"half-student": {
|
||||
"tokens": [
|
||||
19,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "47<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 47,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-1",
|
||||
"task": "lookup",
|
||||
"gold": 28,
|
||||
"arms": {
|
||||
"half-student": {
|
||||
"tokens": [
|
||||
19,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "47<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 47,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-0",
|
||||
"task": "lookup",
|
||||
"gold": 42,
|
||||
"arms": {
|
||||
"half-student": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-1",
|
||||
"task": "lookup",
|
||||
"gold": 56,
|
||||
"arms": {
|
||||
"half-student": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-0",
|
||||
"task": "lookup",
|
||||
"gold": 93,
|
||||
"arms": {
|
||||
"half-student": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-1",
|
||||
"task": "lookup",
|
||||
"gold": 83,
|
||||
"arms": {
|
||||
"half-student": {
|
||||
"tokens": [
|
||||
19,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "43<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 43,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-0",
|
||||
"task": "lookup",
|
||||
"gold": 23,
|
||||
"arms": {
|
||||
"half-student": {
|
||||
"tokens": [
|
||||
23,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "89<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 89,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-1",
|
||||
"task": "lookup",
|
||||
"gold": 89,
|
||||
"arms": {
|
||||
"half-student": {
|
||||
"tokens": [
|
||||
23,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "89<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 89,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-0",
|
||||
"task": "lookup",
|
||||
"gold": 63,
|
||||
"arms": {
|
||||
"half-student": {
|
||||
"tokens": [
|
||||
19,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "49<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 49,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-1",
|
||||
"task": "lookup",
|
||||
"gold": 49,
|
||||
"arms": {
|
||||
"half-student": {
|
||||
"tokens": [
|
||||
19,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"response": "44<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 44,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-0",
|
||||
"task": "lookup",
|
||||
"gold": 78,
|
||||
"arms": {
|
||||
"half-student": {
|
||||
"tokens": [
|
||||
22,
|
||||
23,
|
||||
248046
|
||||
],
|
||||
"response": "78<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 78,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-1",
|
||||
"task": "lookup",
|
||||
"gold": 29,
|
||||
"arms": {
|
||||
"half-student": {
|
||||
"tokens": [
|
||||
18,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "31<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 31,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-0",
|
||||
"task": "lookup",
|
||||
"gold": 64,
|
||||
"arms": {
|
||||
"half-student": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-1",
|
||||
"task": "lookup",
|
||||
"gold": 50,
|
||||
"arms": {
|
||||
"half-student": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"questions": 16,
|
||||
"correct": {
|
||||
"prior-lisa": 5,
|
||||
"trajectory-student": 2,
|
||||
"trajectory-reference": 3,
|
||||
"half-student": 4,
|
||||
"half-reference": 4
|
||||
},
|
||||
"pairs_both_correct": {
|
||||
"prior-lisa": 1,
|
||||
"trajectory-student": 0,
|
||||
"trajectory-reference": 0,
|
||||
"half-student": 0,
|
||||
"half-reference": 0
|
||||
},
|
||||
"comparisons": {
|
||||
"half-student-vs-prior-lisa": {
|
||||
"delta": -0.0625,
|
||||
"corrected": [],
|
||||
"lost": [
|
||||
"validation-003-1"
|
||||
]
|
||||
},
|
||||
"half-student-vs-trajectory-student": {
|
||||
"delta": 0.125,
|
||||
"corrected": [
|
||||
"validation-003-0",
|
||||
"validation-006-0"
|
||||
],
|
||||
"lost": []
|
||||
},
|
||||
"half-student-vs-half-reference": {
|
||||
"delta": 0.0,
|
||||
"corrected": [],
|
||||
"lost": []
|
||||
},
|
||||
"half-reference-vs-prior-lisa": {
|
||||
"delta": -0.0625,
|
||||
"corrected": [],
|
||||
"lost": [
|
||||
"validation-003-1"
|
||||
]
|
||||
},
|
||||
"half-reference-vs-trajectory-reference": {
|
||||
"delta": 0.0625,
|
||||
"corrected": [
|
||||
"validation-003-0"
|
||||
],
|
||||
"lost": []
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"outputs_sha256": {
|
||||
"spec.json": "42493f0ba187228420871f6e3623eca3af810811105683d75b55b7d6bba65abe",
|
||||
"decision.json": "3b0f40939250bd3014cc206ba834cab2a5237efd4325ef5dd6b6e358ddcdf864",
|
||||
"validation/half-student.json": "c9ec45bb1478b7f5dc548fcb0c3c21a258c3623a2af763fddf207278e60080b5",
|
||||
"validation/half-reference.json": "709feb5b11407d4d69f289fa904750c516e280d1774d33d8a51759008cfb380c",
|
||||
"validation/summary.json": "f01240d075eff485632555be05400dc4a8cb016f82234ffa4803e244e7c9d395"
|
||||
},
|
||||
"splits_checked": {
|
||||
"validation": {
|
||||
"questions": 16,
|
||||
"midpoint_token_streams_verified": 32,
|
||||
"controls_verified": 48,
|
||||
"paired_comparisons_verified": 5
|
||||
}
|
||||
},
|
||||
"decision": {
|
||||
"qualified_validation_prefixes": [],
|
||||
"test_evaluated": false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
[
|
||||
{
|
||||
"id": "fit-lookup-000",
|
||||
"tokens": [
|
||||
23,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 1.0708420276641846
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-001",
|
||||
"tokens": [
|
||||
20,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 0.359794944524765
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-002",
|
||||
"tokens": [
|
||||
22,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 1.7561622858047485
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-003",
|
||||
"tokens": [
|
||||
21,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 0.8009884357452393
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-004",
|
||||
"tokens": [
|
||||
24,
|
||||
21,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 1.570459008216858
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-005",
|
||||
"tokens": [
|
||||
20,
|
||||
15,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 1.1894524097442627
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-006",
|
||||
"tokens": [
|
||||
22,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 2.783402442932129
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-007",
|
||||
"tokens": [
|
||||
17,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 1.4688148498535156
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-008",
|
||||
"tokens": [
|
||||
19,
|
||||
21,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 1.3527965545654297
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-009",
|
||||
"tokens": [
|
||||
18,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 1.4242044687271118
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-010",
|
||||
"tokens": [
|
||||
19,
|
||||
20,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 0.16955293715000153
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-011",
|
||||
"tokens": [
|
||||
17,
|
||||
23,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 2.670910596847534
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-012",
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 1.7502222061157227
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-013",
|
||||
"tokens": [
|
||||
19,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 0.21196232736110687
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-014",
|
||||
"tokens": [
|
||||
19,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 1.677167296409607
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-015",
|
||||
"tokens": [
|
||||
24,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 0.1573168784379959
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-016",
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 0.09522029012441635
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-017",
|
||||
"tokens": [
|
||||
23,
|
||||
15,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 1.6205872297286987
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-018",
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 1.0968724489212036
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-019",
|
||||
"tokens": [
|
||||
24,
|
||||
21,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 0.365121454000473
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-020",
|
||||
"tokens": [
|
||||
24,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 0.20771723985671997
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-021",
|
||||
"tokens": [
|
||||
24,
|
||||
17,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 1.0566303730010986
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-022",
|
||||
"tokens": [
|
||||
17,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 2.1767852306365967
|
||||
},
|
||||
{
|
||||
"id": "fit-lookup-023",
|
||||
"tokens": [
|
||||
19,
|
||||
21,
|
||||
248046
|
||||
],
|
||||
"reverse_kl": 1.3833431005477905
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,290 @@
|
||||
[
|
||||
{
|
||||
"id": "validation-000-0",
|
||||
"task": "lookup",
|
||||
"gold": 44,
|
||||
"arms": {
|
||||
"validation-reference": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-000-1",
|
||||
"task": "lookup",
|
||||
"gold": 91,
|
||||
"arms": {
|
||||
"validation-reference": {
|
||||
"tokens": [
|
||||
24,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "91<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 91,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-0",
|
||||
"task": "lookup",
|
||||
"gold": 33,
|
||||
"arms": {
|
||||
"validation-reference": {
|
||||
"tokens": [
|
||||
19,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "47<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 47,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-001-1",
|
||||
"task": "lookup",
|
||||
"gold": 28,
|
||||
"arms": {
|
||||
"validation-reference": {
|
||||
"tokens": [
|
||||
19,
|
||||
22,
|
||||
248046
|
||||
],
|
||||
"response": "47<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 47,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-0",
|
||||
"task": "lookup",
|
||||
"gold": 42,
|
||||
"arms": {
|
||||
"validation-reference": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-002-1",
|
||||
"task": "lookup",
|
||||
"gold": 56,
|
||||
"arms": {
|
||||
"validation-reference": {
|
||||
"tokens": [
|
||||
20,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "51<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 51,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-0",
|
||||
"task": "lookup",
|
||||
"gold": 93,
|
||||
"arms": {
|
||||
"validation-reference": {
|
||||
"tokens": [
|
||||
19,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "43<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 43,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-003-1",
|
||||
"task": "lookup",
|
||||
"gold": 83,
|
||||
"arms": {
|
||||
"validation-reference": {
|
||||
"tokens": [
|
||||
19,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "43<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 43,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-0",
|
||||
"task": "lookup",
|
||||
"gold": 23,
|
||||
"arms": {
|
||||
"validation-reference": {
|
||||
"tokens": [
|
||||
17,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "29<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 29,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-004-1",
|
||||
"task": "lookup",
|
||||
"gold": 89,
|
||||
"arms": {
|
||||
"validation-reference": {
|
||||
"tokens": [
|
||||
23,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "89<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 89,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-0",
|
||||
"task": "lookup",
|
||||
"gold": 63,
|
||||
"arms": {
|
||||
"validation-reference": {
|
||||
"tokens": [
|
||||
19,
|
||||
24,
|
||||
248046
|
||||
],
|
||||
"response": "49<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 49,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-005-1",
|
||||
"task": "lookup",
|
||||
"gold": 49,
|
||||
"arms": {
|
||||
"validation-reference": {
|
||||
"tokens": [
|
||||
19,
|
||||
19,
|
||||
248046
|
||||
],
|
||||
"response": "44<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 44,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-0",
|
||||
"task": "lookup",
|
||||
"gold": 78,
|
||||
"arms": {
|
||||
"validation-reference": {
|
||||
"tokens": [
|
||||
22,
|
||||
23,
|
||||
248046
|
||||
],
|
||||
"response": "78<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 78,
|
||||
"correct": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-006-1",
|
||||
"task": "lookup",
|
||||
"gold": 29,
|
||||
"arms": {
|
||||
"validation-reference": {
|
||||
"tokens": [
|
||||
18,
|
||||
16,
|
||||
248046
|
||||
],
|
||||
"response": "31<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 31,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-0",
|
||||
"task": "lookup",
|
||||
"gold": 64,
|
||||
"arms": {
|
||||
"validation-reference": {
|
||||
"tokens": [
|
||||
24,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "93<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 93,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "validation-007-1",
|
||||
"task": "lookup",
|
||||
"gold": 50,
|
||||
"arms": {
|
||||
"validation-reference": {
|
||||
"tokens": [
|
||||
19,
|
||||
18,
|
||||
248046
|
||||
],
|
||||
"response": "43<|im_end|>",
|
||||
"stop": "eos",
|
||||
"answer": 43,
|
||||
"correct": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user