Download docs/final_deck/slides/switch.html from Anupam-Rawat-IITB/code-switch-mtp: direct link, hf CLI and curl.
- Browser
- Download file 6.53 kB
-
https://huggingface.co/Anupam-Rawat-IITB/code-switch-mtp/resolve/main/docs/final_deck/slides/switch.html
- Command line
-
hf download hf://Anupam-Rawat-IITB/code-switch-mtp/docs/final_deck/slides/switch.html
-
curl -L -o switch.html https://huggingface.co/Anupam-Rawat-IITB/code-switch-mtp/resolve/main/docs/final_deck/slides/switch.html
6.53 kB
| <section id="switch" class="v z4"> | |
| <h2 class="v-title">Switch points are not special; drafting is weak inside English words</h2> | |
| <table class="t v-t"> | |
| <tr class="t-head"><th>Position in the text</th><th class="v-w">First draft equals the frozen model’s choice</th><th class="v-c">Accepted drafts, tree</th><th class="v-w">Accepted drafts, tree + copied branch</th></tr> | |
| <tr><td>Entering English</td><td>40%</td><td>1.12</td><td>1.28</td></tr> | |
| <tr><td>Returning to Hindi, function word</td><td>60%</td><td>1.62</td><td>1.80</td></tr> | |
| <tr><td>Returning to Hindi, content word</td><td>40%</td><td>1.08</td><td>1.18</td></tr> | |
| <tr><td>Inside English words</td><td><b>30%</b></td><td>0.80</td><td>1.04</td></tr> | |
| <tr><td>Control: Hindi group start</td><td>41%</td><td>1.27</td><td>1.43</td></tr> | |
| </table> | |
| <ul class="v-takes"> | |
| <li>Entering English (40%) is as hard as an ordinary Hindi group start (41%).</li> | |
| <li>Inside English words the first draft is right 30% of the time, though the frozen model is right 64%.</li> | |
| <li>Training on code-switch-enriched Hindi lifts that to 34%; English prose alone does not.</li> | |
| </ul> | |
| <aside>Real Hindi text with English words in it. The first column is agreement with the frozen model, which is what lossless verification accepts. Detail moved from the slide: Earlier title: Hindi-English switch points, with and without the copied branch. Hindi (Devanagari), real held-out text (512 documents × 512 tokens), dependent heads with backbone targets, 3 seeds pooled. Drafts are scored against the frozen model’s own 5-token continuation of the text before each position. Row: Position | Positions | Word seen earlier in the document | Frozen model’s choice is the text token | First draft is the frozen model’s choice | Accepted drafts, tree at 8 | Accepted drafts, tree + copied branch at 8. Row: Entering English | 382 | 29% | 19% | 40% [35, 46] | 1.12 | 1.28. Row: Returning to Hindi, function word | 198 | 64% | 59% | 60% [51, 68] | 1.62 | 1.80. Row: Returning to Hindi, content word | 195 | 23% | 20% | 40% [32, 48] | 1.08 | 1.18. Row: Inside English words | 1,673 | 24% | 64% | 30% [26, 35] | 0.80 | 1.04. Row: Control: Hindi group start | 1,000 | 30% | 31% | 41% [38, 44] | 1.27 | 1.43. Row: Control: Hindi function-word start | 1,000 | 63% | 66% | 72% [70, 74] | 2.04 | 2.09. Row: Control: inside a Hindi word | 1,000 | 32% | 71% | 70% [68, 73] | 1.88 | 2.09. Against the frozen model’s choice, switch points are not special. Entering English and returning on a content word both give 40%, the same as an ordinary Hindi group start (41%). The low agreement with the text there (5% to 7%) is the frozen model’s: it predicts the text token only 19% to 20% of the time. The weak position is inside English words. The frozen model is right 64% of the time there, and the first draft follows it only 30% of the time. Copying does not rescue switches. Only 29% of the English words entered were seen earlier in the document. The copied branch adds 0.10 to 0.18 accepted drafts at switches, about what it adds at ordinary group starts (0.16). English inside Hindi text closes part of the gap; English alone does not. Heads trained on 8M Devanagari and 2M English tokens leave the first draft inside English words at 31% against 30% (seed 0, difference −1 to +3 points). Heads trained on Hindi text with three times the usual share of code-switched passages raise it to 34% (2 seeds, +2.8 to +5.7 points; accepted drafts 0.81 to 0.88). Entering English stays at 40%. Cost on Devanagari documents: 1.1% tokens per pass with the tree at 8. Compute. 20.5 min on the Quadro P6000 (24 GB), fp32, peak 5.5 GB: 17.5 min for 5,448 five-token continuations, 1 min per seed for both stacks. Inference only. Mixed heads: 3.0 h training on the Quadro P6000 (932 tokens/s, 7.4 GB). Code-switch-enriched heads: 2.8 h per seed on a GTX 1080 Ti (1,000 tokens/s, 7.4 GB). 18 to 19 min for this table per stack pair. Further notes: Brackets are 95% intervals from a bootstrap over documents. Intervals on the accepted-draft means are wide at the switch positions (entering English: 1.00 to 1.26 for the tree, 1.12 to 1.45 with the copied branch), so the copy gains there are indicative. The earlier switch table measured agreement with the text token; this one measures agreement with the frozen model, which is what lossless verification accepts. At 16 verified tokens: entering English 1.27 and 1.47, returning on a function word 1.86 and 2.04, returning on a content word 1.19 and 1.34, inside English 0.88 and 1.13, Hindi group start 1.48 and 1.67. Two more heads add 0.02 to 0.07 accepted drafts at switch positions and 0.24 inside Hindi words. Code-switch-enriched heads: from the training text only, the 1,172 training blocks of 512 tokens richest in Latin-script words inside Devanagari text (17 to 252 such tokens each) were repeated 5 times to fill 30% of the 10M-token budget; Latin-script tokens rise from 0.83% to 2.48% of the training tokens. Against Hindi-only heads of the same seed, pooled over seeds 0 and 1, same positions: first draft inside English 34.2% against 30.0% (per seed 35.0 and 33.5 against 29.7 and 30.3); accepted drafts there 0.877 against 0.808 with the tree at 8 (interval of the difference +0.04 to +0.10), 1.120 against 1.048 with the copied branch, 0.962 against 0.890 at 16; entering English 40.7% against 40.4%. Standard Devanagari test documents: tree 2.637 and 2.647 against 2.661 and 2.685 at 8 (−1.1%, interval −2.0 to −0.3), −0.8% at 16, −1.1% at 24. English documents: chain 1.23 against 1.19. English tokens inside Hindi text are under 1% of all tokens, so on ordinary Hindi text the trade is not a speed gain. Mixed heads (Devanagari plus English prose) against Hindi-only heads, seed 0, same positions, accepted drafts with the tree at 8: entering English 1.08 against 1.12, inside English 0.78 against 0.81, Hindi group start 1.26 against 1.26; with the copied branch 1.23 against 1.28 and 1.03 against 1.05. Standard Devanagari test documents, tree at 8, 16, 24: 2.595, 2.782, 2.823 against 2.661, 2.833, 2.899. English documents: chain 1.59 against 1.19 for Hindi-only heads and 1.75 for English-only heads. The 2M English tokens are English Wikipedia, mixed with the Hindi text at the level of 512-token training blocks, not code-switched text. Copied branch: opens at 29% of positions entering English and its first token is right 35% of the time when open; inside English words it opens at 15% and is right 72% of the time.</aside> | |
| </section> | |