rwkv_doomloop_experiment / metrics_guide.md
Ilikemechuri's picture
Upload folder using huggingface_hub
83926c5 verified
|
Raw History Blame Contribute Delete
3.97 kB
# CSV ์ง€ํ‘œ ์•ˆ๋‚ด
## token_metrics.csv ๊ณตํ†ต ์—ด
- `predicts_token_step`: ์ƒ์„ฑ๋  ํ† ํฐ ๋ฒˆํ˜ธ (1๋ถ€ํ„ฐ ์‹œ์ž‘).
- `context_generated_tokens`: logits๋ฅผ ๋งŒ๋“ค ๋•Œ recurrent state์— ํฌํ•จ๋œ ์ƒ์„ฑ ํ† ํฐ ์ˆ˜.
- `generated_token_id`: ์‹ค์ œ ์„ ํƒ๋œ tokenizer ID.
- `top1_probability`, `entropy_nats`, `top1_top2_margin`: ํŒจ๋„ํ‹ฐ ์—†๋Š” ์กฐ๊ฑด์˜ ๋‹ค์Œ-token ๋ถ„ํฌ ์ง€ํ‘œ.
- `wkv_rms_mean`, `wkv_rms_max`: 24๊ฐœ ์ธต์˜ WKV recurrent matrix RMS ํ‰๊ท /์ตœ๋Œ“๊ฐ’.
- `att_shift_rms_mean`, `ffn_shift_rms_mean`: shift state RMS์˜ ์ธต ํ‰๊ท .
- `wkv_delta_rms`, `att_shift_delta_rms`, `ffn_shift_delta_rms`: ํ˜„์žฌ context update ์ „ํ›„ state ์ฐจ์ด์˜ RMS.
- `wkv_layer_00_rms` โ€ฆ `wkv_layer_23_rms`: ์ธต๋ณ„ WKV RMS. attention/FFN shift๋„ ๊ฐ™์€ ์—ด ๊ตฌ์กฐ.
- `rolling_dup8_rate_64`: ์ตœ๊ทผ 64๊ฐœ ํ† ํฐ ๋‚ด ์ค‘๋ณต 8-gram ๋น„์œจ.
## Penalty CSV ์ถ”๊ฐ€ ์—ด
- `raw_*`: ๋ฐ˜๋ณต ํŒจ๋„ํ‹ฐ ์ ์šฉ ์ „ ๋ชจ๋ธ ์›์‹œ logits์˜ ํ†ต๊ณ„.
- `penalty_*`: Transformers repetition processor ์ ์šฉ ํ›„ generation score์˜ ํ†ต๊ณ„.
- `penalty_argmax_matches_generated`: ๊ฐ ๋‹จ๊ณ„์—์„œ penalty score์˜ argmax๊ฐ€ ์‹ค์ œ greedy ์ƒ์„ฑ ํ† ํฐ๊ณผ ์ผ์น˜ํ•˜๋Š”์ง€.
## State cosine ์š”์•ฝ
`cycle_similarity_vs_step_241.csv`์˜ ๊ฐ state cosine์€ ๊ฐ™์€ ์œ„์น˜์— ์žˆ๋Š” ์ฒซ ์ˆ˜์‹ ํ† ํฐ (step 241)์˜ recurrent state์™€ ํ•ด๋‹น ๋ฐ˜๋ณต ์ง€์  state ์‚ฌ์ด์˜ ์ธต๋ณ„ cosine ํ‰๊ท /์ตœ์†Ÿ๊ฐ’์ด๋‹ค. `*_rel_l2_mean`์€ ์ธต๋ณ„ ์ƒ๋Œ€ L2 ๊ฑฐ๋ฆฌ์˜ ํ‰๊ท ์ด๋‹ค.
## OLMo token metrics
- OLMo ๋ฐ ์˜์–ด system ์ถ”๊ฐ€ ์‹คํ–‰์˜ `raw_*`๋Š” `lm_head` forward hook์—์„œ generation processor ์ ์šฉ ์ „ logits๋ฅผ ๊ธฐ๋กํ•œ๋‹ค.
- `processed_*`๋Š” `generate(output_scores=True)`๊ฐ€ ๋ฐ˜ํ™˜ํ•œ processor ์ ์šฉ ํ›„ ์ ์ˆ˜๋‹ค. repetition penalty๊ฐ€ 1.0์ธ ์กฐ๊ฑด์—์„œ๋Š” raw์™€ ๋™์ผํ•˜๋‹ค.
- `processed_argmax_matches_generated` ํ™•์ธ ๊ฒฐ๊ณผ๋Š” greedy score argmax์™€ ์ถœ๋ ฅ token์˜ ๋Œ€์‘์„ ๊ธฐ๋กํ•œ๋‹ค.
- `rolling_dup8_rate_64`๋Š” ์ƒ์„ฑ๋œ token ์ค‘ ์ตœ๊ทผ ์ตœ๋Œ€ 64๊ฐœ์—์„œ 8-gram occurrence ์ค‘ ์ค‘๋ณต๋œ ๋น„์œจ์ด๋‹ค. ๋ชจ๋ธ๋ณ„ tokenizer๊ฐ€ ๋‹ฌ๋ผ RWKV/OLMo ๊ฐ„ token n-gram ๊ธธ์ด๋Š” ์ง์ ‘ ๋น„๊ตํ•  ์ˆ˜ ์—†๋‹ค.
- OLMo 2๋Š” Transformer์ด๋ฏ€๋กœ RWKV์˜ WKV/shift recurrent state ์—ด์€ ์—†๋‹ค.
- ์ถ”๊ฐ€ RWKV ์˜์–ด system run์€ ๊ธฐ์กด์ฒ˜๋Ÿผ WKV/attention-shift/FFN-shift RMS๋ฅผ ๊ธฐ๋กํ•˜๋ฉฐ, `*_delta_rms`๋Š” ์ง์ „ generation forward ์‹œ์  ๋Œ€๋น„ recurrent state ๋ณ€ํ™”๋Ÿ‰์ด๋‹ค.
## Periodic harness metrics
- `predicts_response_token_step` counts only newly generated assistant response tokens across chunks. Prompt, harness-message, and chat-template tokens are excluded.
- `harness_chunk_index` and `chunk_token_step` locate a token within the 256-token generation call. `context_tokens_for_chunk` is the full tokenized input length for that call, including the prior transcript and harness messages.
- `harness_events.csv` records one row per completed chunk, including the cumulative response-token count, usage-update content length, and next call's context length. Seven usage messages are sent for an eight-chunk 2,048-token response; the final 2,048 checkpoint is logged without a follow-up message.
- `total_context_tokens_processed` sums the complete input length at each call. Because the harness re-renders and replays the full conversation every 256 tokens, earlier answer tokens are counted again as input on later chunks. This is not the assistant response-token count.
- `total_harness_message_content_tokens` counts only each update's text content with that model's tokenizer; it excludes role markers and other chat-template overhead.
- RWKV state hooks reset per chunk. The first row in a chunk measures the state after prefilling that chunk's full conversation context; its `*_delta_rms` is relative to a zero state, while later rows are relative to the preceding forward in the same chunk.
- `assistant_chunks.md` preserves each generated chunk separately; `generation.txt` joins the assistant text chunks without showing harness messages.