Anupam-Rawat-IITB's picture
Refresh to the current main: code, results, logs and the final deck
c5241c0 verified
Raw History Blame Contribute Delete
5.8 kB
<section id="results" class="v z0">
<h2 class="v-title">Lossless decoding at 2.9× greedy speed on Hindi (Devanagari) and 4.9× on Hindi (ITRANS)</h2>
<p class="v-by">CS 769 project, group G31. Anupam Rawat, Sujeet Kumar Singh, Bilal Baig. Mentor: Karthika N J.</p>
<table class="t v-t">
<tr class="t-head"><th>Speed-up over greedy decoding</th><th class="v-c">Chain of 3 drafts</th><th class="v-c">Draft tree</th><th class="v-c">Tree + 12 copied tokens</th><th class="v-c">Same, low-looping documents</th></tr>
<tr><td>Hindi (Devanagari)</td><td>1.8×</td><td>1.9×</td><td><b>2.9×</b></td><td>2.6×</td></tr>
<tr><td>Hindi (ITRANS)</td><td>1.4×</td><td>1.4×</td><td><b>4.9×</b></td><td>5.6×</td></tr>
<tr><td>Hindi (IAST)</td><td>1.6×</td><td>1.6×</td><td><b>5.6×</b></td><td>6.3×</td></tr>
<tr><td>Hindi (ISO)</td><td>1.6×</td><td>1.7×</td><td><b>5.5×</b></td><td>6.1×</td></tr>
<tr><td>English</td><td>1.5×</td><td>1.5×</td><td><b>1.8×</b></td><td>1.6×</td></tr>
</table>
<ul class="v-takes">
<li>Output is identical to greedy decoding on every document.</li>
<li>The copied tokens give the speed; the draft tree alone is no faster than the chain.</li>
<li>Romanized Hindi is fastest because its continuation largely restates the prompt.</li>
</ul>
<p class="v-cav">Measured end to end on one GTX 1080 Ti, fp32, batch size 1, 16 verified tokens per round.</p>
<aside>Say: the output is the same as greedy decoding, token for token, and it comes out 2.9 times faster in Devanagari. The low-looping column is the same system on documents where the model does not repeat itself. Detail moved from the slide: Lossless decoding at 2.9× greedy speed on Hindi (Devanagari) and 4.9× on Hindi (ITRANS), measured end to end. Output is identical to greedy decoding on every document in every system. Frozen Llama-3.2-1B with three look-ahead draft heads. Speed-up over greedy decoding, end to end, 16 verified tokens per round. About 120 held-out documents × 64 new tokens per condition, 3 seeds for Hindi (Devanagari), seed 0 for the others, drafting from a 4,352-token shortlist. Row: Condition | Chain of 3 drafts | Tree | Tree + 5 copied tokens | Tree + 8 copied tokens | Tree + 12 copied tokens | Low-looping documents | Greedy, ms per word | Best, ms per word. Row: Hindi (Devanagari) | 1.85× | 1.86× | 2.50× | 2.75× | 2.90× | 2.62× | 46.1 | 15.9. Row: Hindi (ITRANS) | 1.40× | 1.43× | 3.19× | 4.11× | 4.95× | 5.63× | 47.4 | 9.6. Row: Hindi (IAST) | 1.58× | 1.61× | 3.36× | 4.47× | 5.57× | 6.28× | 57.2 | 10.3. Row: Hindi (ISO) | 1.60× | 1.65× | 3.39× | 4.47× | 5.45× | 6.07× | 61.3 | 11.2. Row: English | 1.46× | 1.51× | 1.77× | 1.83× | 1.85× | 1.56× | 24.1 | 13.1. Chain: one draft per head. Tree: the 16 most confident draft nodes. Copied tokens: if the last two or more tokens occurred earlier, that many verified tokens are the ones that followed. What it shows. Lossless in practice. Every system reproduces greedy output token for token. The copied branch is the speed gain. In Devanagari, 2.9× with 12 copied tokens against 1.85× for the chain. The tree alone is not faster than the chain. Its 29% more tokens per pass are spent on a longer backbone pass. Romanized Hindi goes from slowest to fastest. 87% to 89% of its continuation tokens repeat the prompt (Devanagari 55%, English 13%). Where the time of one round goes. Hindi (Devanagari), seed 0, tree + 12 copied tokens, 16 verified tokens, ms per round. Row: Draft the tree (3 heads, shortlist) | 2.1. Row: Suffix lookup for the copied branch | 0.03. Row: Build inputs and attention mask | 0.40. Row: Backbone pass over 17 tokens and argmax | 23.3. Row: Accept the path, update the cache | 1.8. Row: One round, 4.42 tokens | 27.6. Row: Greedy decoding, 1 token | 18.1. Limits of the measurement. One GTX 1080 Ti, fp32, batch size 1, a Python decoder, greedy decoding, 64 new tokens after a 256-token prompt. Greedy decoding with a 1B model loops. Low-looping: tree + 12 copied tokens on documents where at most 10% of the continuation repeats itself (44 to 65 per condition). In romanized Hindi the continuation largely restates the prompt, which is what the copied tokens exploit. Compute. 3 × GTX 1080 Ti (11 GB) + 1 × Quadro P6000 (24 GB), fp32. Timing: 10 to 34 min per run on one idle GTX 1080 Ti, peak 5.9 GB. Heads: 15 runs × 10M tokens, 6 to 8 h each, 350 to 465 tokens/s, peak 8.8 GB. Further notes: Systems are timed after the prompt is encoded; every step of a round is timed with the GPU synchronised and the reported time is the sum. Output is identical to greedy on every document in every system: 119 documents in Devanagari and ITRANS, 122 in IAST, 124 in ISO and English. Devanagari per seed, tree with 12 copied tokens: 2.90×, 2.89×, 2.90×; with 5 copied tokens 2.49×, 2.50×, 2.51×; chain 1.84×, 1.85×, 1.85×. At 24 verified tokens with 12 copied tokens: 2.96× in Devanagari (2.69× on low-looping documents) and 4.92× in ITRANS (5.55×). At 8 verified tokens with 5 copied tokens: 2.41× in Devanagari and 3.23× in ITRANS. The tokens per pass of the real decoder equal the replay figures on the backup slides to the third decimal. With the full vocabulary instead of the shortlist the Devanagari tree runs at 1.36×, because drafting then takes 10 ms per round instead of 2 ms. Ending the copied tokens at the word-group boundary instead of a fixed length lowers tokens per pass by 7% to 22% in every condition. Five look-ahead heads are not faster than three. A learned allocator between head and copied nodes adds about 1% at 16 verified tokens with 5 copied tokens (1 seed). Greedy decoding takes 18.0 to 18.1 ms per token in every condition; words per token: 0.392 Devanagari, 0.383 ITRANS, 0.316 IAST, 0.295 ISO, 0.748 English.</aside>
</section>