Download docs/final_deck/dense_v26/copying.html from Anupam-Rawat-IITB/code-switch-mtp: direct link, hf CLI and curl.
- Browser
- Download file 3.69 kB
-
https://huggingface.co/Anupam-Rawat-IITB/code-switch-mtp/resolve/main/docs/final_deck/dense_v26/copying.html
- Command line
-
hf download hf://Anupam-Rawat-IITB/code-switch-mtp/docs/final_deck/dense_v26/copying.html
-
curl -L -o copying.html https://huggingface.co/Anupam-Rawat-IITB/code-switch-mtp/resolve/main/docs/final_deck/dense_v26/copying.html
3.69 kB
| <section id="copying" class="backup"> | |
| <h2 class="b-title">Backup: copying, what the heads miss</h2> | |
| <p class="k-cap">Greedy continuations of the frozen Llama-3.2-1B (256-token prompt, 64 new tokens). Dependent heads with backbone targets, mean of 3 seeds, 8 verified tokens per pass, lossless verification, 119 to 124 held-out documents per condition.</p> | |
| <div class="row"> | |
| <div class="c-left"> | |
| <table class="t ct"> | |
| <tr class="t-head"><th>Condition</th><th class="c-v">Continuation tokens reused from the prompt</th><th class="c-v">Confidence tree, tokens per pass</th><th class="c-v">Tree + copied branch</th><th class="c-g">Gain</th><th class="c-v">Real text: first draft right at group starts</th></tr> | |
| <tr><td>Hindi (Devanagari)</td><td>55%</td><td>2.67</td><td><b>3.58</b></td><td>+34%</td><td>41%</td></tr> | |
| <tr><td>Hindi (ITRANS)</td><td>87%</td><td>2.08</td><td><b>4.78</b></td><td>+130%</td><td>34%</td></tr> | |
| <tr><td>Hindi (IAST)</td><td>88%</td><td>2.29</td><td><b>5.01</b></td><td>+119%</td><td>38%</td></tr> | |
| <tr><td>Hindi (ISO)</td><td>89%</td><td>2.35</td><td><b>5.00</b></td><td>+113%</td><td>45%</td></tr> | |
| <tr><td>English</td><td>13%</td><td>2.18</td><td><b>2.52</b></td><td>+16%</td><td>48% (word starts)</td></tr> | |
| </table> | |
| </div> | |
| <ul class="c-takes"> | |
| <li><b>The heads cannot follow copied words.</b> At Devanagari group starts of words already in the context, the first draft is right 34% of the time, the copied token 60%, one of the two 72%.</li> | |
| <li><b>The copied branch is prompt-lookup drafting, which is prior work.</b> Our contribution is the measurement: how much the frozen model reuses its prompt in each spelling.</li> | |
| <li><b>On real text the spellings are close at group starts.</b> The romanized deficit that remains is at function-word starts: 41% to 53% against 71%.</li> | |
| </ul> | |
| </div> | |
| <p class="k-note"><b>Rule.</b> If the last two or more tokens occurred earlier in the context, verify the 3 most confident tree nodes and the 5 tokens that followed that occurrence; otherwise the tree with 8 nodes. <b>Measured speed</b> with this rule: 2.41× greedy in Devanagari and 3.23× in ITRANS; with 12 copied tokens at 16 verified tokens, 2.90× and 4.95×. <b>Caveats.</b> Greedy decoding with a 1B model loops: 24% to 30% of continuation tokens repeat a 4-gram of the continuation. On documents with little looping the gain is +25% in Devanagari, +121% to +140% in romanized Hindi and +5% in English.</p> | |
| <p class="compute"><b>Compute</b> (one GTX 1080 Ti per condition, fp32, evaluation only, no training). Copied branch: 4.3 to 4.6 min for 3 seeds, peak 5.6 GB. Real-text check on 512 held-out documents: 10.6 to 11.2 min for 3 seeds, peak 5.6 GB.</p> | |
| <aside>Reused from the prompt means the continuation token sits inside a 4-gram that also occurs in the prompt: 54.8% Devanagari, 86.9% ITRANS, 87.9% IAST, 89.4% ISO, 13.1% English. Exact tokens per pass, tree then tree with copied branch: 2.671 and 3.579, 2.076 and 4.780, 2.287 and 5.012, 2.347 and 5.002, 2.175 and 2.521. The copied branch alone (5 copied tokens, no heads) gives 2.22 in Devanagari and 4.52 to 4.64 in romanized Hindi. A threshold on head confidence adds nothing to the suffix-match rule. Real text is held-out text under teacher forcing, so nothing is model-generated; first draft right means the first draft equals the frozen model's choice. Real text by position (Devanagari, ITRANS, IAST, ISO): group start 40.8, 33.7, 38.4, 45.0; function-word start 71.2, 41.2, 43.3, 52.8; inside word 70.3, 54.7, 68.6, 66.5. English: word start 47.9, inside word 42.6. Prompt-lookup drafting proposes the tokens that followed the most recent earlier occurrence of the current suffix.</aside> | |
| </section> | |