(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{31654:(e,t,a)=>{Promise.resolve().then(a.bind(a,52364)),Promise.resolve().then(a.bind(a,19202)),Promise.resolve().then(a.bind(a,9443)),Promise.resolve().then(a.bind(a,88587)),Promise.resolve().then(a.bind(a,64300)),Promise.resolve().then(a.bind(a,70089)),Promise.resolve().then(a.bind(a,32856)),Promise.resolve().then(a.bind(a,31391)),Promise.resolve().then(a.bind(a,79607)),Promise.resolve().then(a.bind(a,5180)),Promise.resolve().then(a.bind(a,94388)),Promise.resolve().then(a.bind(a,96305)),Promise.resolve().then(a.bind(a,10944)),Promise.resolve().then(a.bind(a,52107)),Promise.resolve().then(a.bind(a,15467)),Promise.resolve().then(a.bind(a,50193)),Promise.resolve().then(a.bind(a,4549)),Promise.resolve().then(a.bind(a,59370))},52364:(e,t,a)=>{"use strict";a.d(t,{Citation:()=>s});var r=a(95155);let s=()=>(0,r.jsxs)("section",{className:"footer-section",children:[(0,r.jsx)("h2",{id:"citation",className:"responsive-text-lg font-semibold mb-4",children:"Citation"}),(0,r.jsxs)("div",{className:"footer-content",children:[(0,r.jsx)("p",{className:"responsive-text-sm mb-4",children:"For attribution in academic contexts, please cite this work as"}),(0,r.jsx)("p",{className:"responsive-text-sm mb-6 pl-4 border-l-2 border-gray-200",children:'Lee, et al., "From Digits to Decisions: How Tokenization Impacts Arithmetic in LLMs", 2024.'}),(0,r.jsx)("p",{className:"responsive-text-sm mb-2",children:"BibTeX citation"}),(0,r.jsx)("pre",{className:"responsive-text-sm bg-gray-50 p-4 rounded-md overflow-x-auto text-sm whitespace-pre-wrap",children:"@misc{lee2024digitstodecisions,\n title={From Digits to Decisions: How Tokenization Impacts Arithmetic in LLMs},\n author={Garreth Lee, Guilherme Penedo, Thomas Wolf},\n url={https://huggingface.co/spaces/HuggingFaceFW/blogpost-digitstodecisions},\n}"})]})]})},19202:(e,t,a)=>{"use strict";a.d(t,{Footnotes:()=>i});var r=a(95155),s=a(31391);let i=()=>{let{footnotes:e,getFootnoteNumber:t}=(0,s.L)(),a=e=>{e.preventDefault();let t=e.currentTarget.getAttribute("href");if(t){let e=document.querySelector(t);e&&e.scrollIntoView({behavior:"smooth"})}};return(0,r.jsxs)("footer",{className:"mt-12 border-t border-zinc-200 dark:border-zinc-700",children:[(0,r.jsx)("h2",{id:"footnotes",className:"responsive-text-lg font-semibold mt-8 mb-4",children:"Footnotes"}),(0,r.jsx)("ol",{className:"responsive-text-sm space-y-4",children:Object.entries(e).map(e=>{let[s,i]=e;return(0,r.jsxs)("li",{id:"footnote-".concat(s),className:"text-gray-700",children:[(0,r.jsxs)("span",{children:[t(s),". "]}),i.text,(0,r.jsx)("a",{href:"#footnote-".concat(s),onClick:a,className:"text-primary hover:text-primary/80 ml-1",children:"[↩]"})]},s)})})]})}},9443:(e,t,a)=>{"use strict";a.d(t,{default:()=>s});var r=a(95155);function s(e){let{title:t}=e;return(0,r.jsxs)("div",{className:"relative overflow-hidden",children:[(0,r.jsxs)("div",{className:"absolute inset-0",children:[(0,r.jsx)("img",{src:"https://wallpapers.com/images/hd/renaissance-aesthetic-9qhcaymsmode7v14.jpg",alt:"Hero background",className:"absolute inset-0 w-full h-full object-cover"}),(0,r.jsx)("div",{className:"absolute inset-0 bg-black opacity-60"})]}),(0,r.jsx)("div",{className:"relative max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,r.jsx)("div",{className:"pt-48 pb-48 text-center lg:pt-48",children:(0,r.jsx)("h1",{className:"font-bold tracking-tight text-white sm:text-6xl",children:t})})})]})}},88587:(e,t,a)=>{"use strict";a.d(t,{InlineCitation:()=>l});var r=a(95155),s=a(31391),i=a(53601);function l(e){let{id:t}=e,{citations:a,getCitationNumber:l}=(0,s.g)(),n=a[t],o=l(t);return(0,r.jsx)(i.Bc,{children:(0,r.jsxs)(i.m_,{delayDuration:100,children:[(0,r.jsx)(i.k$,{asChild:!0,children:(0,r.jsx)("span",{id:"".concat(t),children:(0,r.jsx)("sup",{className:"text-xs text-gray-500",children:(0,r.jsxs)("a",{href:"#citation-".concat(t),className:"hover:text-blue-600","aria-label":"Citation ".concat(o),children:["[",o,"]"]})})})}),(0,r.jsx)(i.ZI,{side:"top",sideOffset:4,className:"max-w-[400px]",children:(0,r.jsxs)("p",{className:"text-xs whitespace-normal",children:[(0,r.jsxs)("span",{className:"font-bold",children:[n.title," (",n.year,")"]}),(0,r.jsx)("br",{}),n.authors.join(", ")]})})]})})}},64300:(e,t,a)=>{"use strict";a.d(t,{InlineFootnote:()=>l});var r=a(95155),s=a(31391),i=a(53601);function l(e){let{id:t}=e,{footnotes:a,getFootnoteNumber:l}=(0,s.L)(),n=l(t);return(0,r.jsx)(i.Bc,{children:(0,r.jsxs)(i.m_,{delayDuration:100,children:[(0,r.jsx)(i.k$,{asChild:!0,children:(0,r.jsx)("span",{id:"".concat(t),className:"pl-0.5",children:(0,r.jsx)("sup",{className:"text-xs text-gray-500",children:(0,r.jsx)("a",{href:"#footnote-".concat(t),className:"hover:text-blue-600","aria-label":"Footnote ".concat(n),children:n})})})}),(0,r.jsx)(i.ZI,{side:"top",sideOffset:6,className:"max-w-[400px]",children:(0,r.jsx)("p",{className:"text-xs whitespace-normal",children:a[t].text})})]})})}},70089:(e,t,a)=>{"use strict";a.d(t,{References:()=>n});var r=a(95155),s=a(67396),i=a(41507),l=a(31391);let n=()=>{let{citations:e}=(0,l.g)(),t=Object.entries(e).map(e=>{let[t,a]=e;return{id:t,...a}});return(0,r.jsxs)("section",{className:"footer-section",children:[(0,r.jsx)("h2",{id:"references",className:"responsive-text-lg font-semibold",children:"References"}),(0,r.jsx)("div",{className:"footer-content",children:(0,r.jsx)("ol",{className:"list-decimal list-outside ml-6 space-y-2",children:t.map(e=>(0,r.jsx)("li",{id:"citation-".concat(e.id),className:"text-gray-700 text-xs",children:(0,r.jsxs)("div",{children:[e.authors.join(", "),', "',e.title,'"',e.journal&&(0,r.jsxs)("span",{className:"italic",children:[" ",e.journal]}),e.publisher&&(0,r.jsxs)("span",{className:"italic",children:[" ",e.publisher]}),", ",e.year,".",e.doi&&(0,r.jsxs)("span",{children:[" DOI: ",e.doi]}),e.url&&(0,r.jsxs)(s.default,{href:e.url,className:"inline-flex items-center ml-2 text-primary hover:text-primary/80",children:["[",(0,r.jsx)(i.A,{className:"h-4 w-4 mx-0.5"}),"Link]"]})]})},e.id))})})]})}},32856:(e,t,a)=>{"use strict";a.d(t,{TableOfContents:()=>l});var r=a(95155),s=a(12115),i=a(67396);let l=()=>{let[e,t]=(0,s.useState)([]),[a,l]=(0,s.useState)("");(0,s.useEffect)(()=>{let e=document.querySelectorAll("h2, h3, h4, h5, h6");t(Array.from(e).map(e=>({id:e.id,text:e.textContent||"",level:parseInt(e.tagName[1])})).slice(1));let a=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&e.target.id&&l(e.target.id)})},{rootMargin:"-20px 0px -80% 0px"});return e.forEach(e=>{a.observe(e)}),()=>{e.forEach(e=>{a.unobserve(e)})}},[]);let n=(e,t)=>{e.preventDefault();let a=document.getElementById(t);if(a){let e=document.body.getBoundingClientRect().top,t=a.getBoundingClientRect().top;window.scrollTo({top:t-e-80-20,behavior:"smooth"})}};return(0,r.jsxs)("nav",{className:"w-full",children:[(0,r.jsx)("h2",{className:"text-sm font-bold mb-3",children:"Table of Contents"}),(0,r.jsx)("ul",{className:"text-sm space-y-1.5",children:e.map(e=>{let t=a===e.id;return(0,r.jsx)("li",{className:"\n ".concat(2===e.level?"ml-0":"ml-3","\n "),children:(0,r.jsx)(i.default,{href:"#".concat(e.id),className:"\n text-gray-600 hover:text-gray-900 transition-colors duration-200 \n block py-1 px-2 rounded-md hover:bg-gray-50 min-w-[20ch]\n ".concat(t?"bg-gray-100 text-gray-900 font-medium":"","\n "),onClick:t=>n(t,e.id),children:e.text})},e.id)})})]})}},22130:(e,t,a)=>{"use strict";a.d(t,{Wu:()=>d,ZB:()=>o,Zp:()=>l,aR:()=>n});var r=a(95155),s=a(12115),i=a(21567);let l=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("rounded-xl border bg-card text-card-foreground shadow",a),...s})});l.displayName="Card";let n=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("flex flex-col space-y-1.5 p-6",a),...s})});n.displayName="CardHeader";let o=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("font-semibold leading-none tracking-tight",a),...s})});o.displayName="CardTitle",s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("text-sm text-muted-foreground",a),...s})}).displayName="CardDescription";let d=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("p-6 pt-0",a),...s})});d.displayName="CardContent",s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("flex items-center p-6 pt-0",a),...s})}).displayName="CardFooter"},53601:(e,t,a)=>{"use strict";a.d(t,{Bc:()=>n,ZI:()=>c,k$:()=>d,m_:()=>o});var r=a(95155),s=a(12115),i=a(12134),l=a(21567);let n=i.Kq,o=i.bL,d=i.l9,c=s.forwardRef((e,t)=>{let{className:a,sideOffset:s=4,...n}=e;return(0,r.jsx)(i.ZL,{children:(0,r.jsx)(i.UC,{ref:t,sideOffset:s,className:(0,l.cn)("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...n})})});c.displayName=i.UC.displayName},31391:(e,t,a)=>{"use strict";a.d(t,{CitationProvider:()=>o,g:()=>d,L:()=>c});var r=a(95155),s=a(12115);let i={mirzadeh2024:{authors:["Mirzadeh, I.","Alizadeh, K.","Shahrokhi, H.","Tuzel, O.","Bengio, S.","Farajtabar, M."],year:2024,title:"GSM-Symbolic: Understanding the Limitations of Mathematical Reasoning in Large Language Models",archivePrefix:"arXiv",eprint:"2410.05229",primaryClass:"cs.LG",url:"https://arxiv.org/abs/2410.05229"},xu2024:{authors:["Xu, N.","Ma, X."],year:2024,title:"LLM The Genius Paradox: A Linguistic and Math Expert's Struggle with Simple Word-based Counting Problems",archivePrefix:"arXiv",eprint:"2410.14166",primaryClass:"cs.CL",url:"https://arxiv.org/abs/2410.14166"},radford2019:{authors:["Radford, A.","Wu, J.","Child, R.","Luan, D.","Amodei, D.","Sutskever, I."],year:2019,title:"Language Models are Unsupervised Multitask Learners",url:"https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf"},touvron2023llama:{authors:["Touvron, H.","Lavril, T.","Izacard, G.","Martinet, X.","Lachaux, M.","Lacroix, T.","Rozi\xe8re, B.","Goyal, N.","Hambro, E.","Azhar, F.","Rodriguez, A.","Joulin, A.","Grave, E.","Lample, G."],year:2023,title:"LLaMA: Open and Efficient Foundation Language Models",eprint:"2302.13971",archivePrefix:"arXiv",primaryClass:"cs.CL",url:"https://arxiv.org/abs/2302.13971"},touvron2023llama2:{authors:["Touvron, H.","Martin, L.","Stone, K.","Albert, P.","Almahairi, A.","Babaei, Y.","Bashlykov, N.","Batra, S.","Bhargava, P.","Bhosale, S.","Bikel, D.","Blecher, L.","Canton Ferrer, C.","Chen, M.","Cucurull, G.","Esiobu, D.","Fernandes, J.","Fu, J.","Fu, W.","Fuller, B.","Gao, C.","Goswami, V.","Goyal, N.","Hartshorn, A.","Hosseini, S.","Hou, R.","Inan, H.","Kardas, M.","Kerkez, V.","Khabsa, M.","Kloumann, I.","Korenev, A.","Koura, P. S.","Lachaux, M.","Lavril, T.","Lee, J.","Liskovich, D.","Lu, Y.","Mao, Y.","Martinet, X.","Mihaylov, T.","Mishra, P.","Molybog, I.","Nie, Y.","Poulton, A.","Reizenstein, J.","Rungta, R.","Saladi, K.","Schelten, A.","Silva, R.","Smith, E. M.","Subramanian, R.","Tan, X. E.","Tang, B.","Taylor, R.","Williams, A.","Kuan, J. X.","Xu, P.","Yan, Z.","Zarov, I.","Zhang, Y.","Fan, A.","Kambadur, M.","Narang, S.","Rodriguez, A.","Stojnic, R.","Edunov, S.","Scialom, T."],year:2023,title:"Llama 2: Open Foundation and Fine-Tuned Chat Models",eprint:"2307.09288",archivePrefix:"arXiv",primaryClass:"cs.CL",url:"https://arxiv.org/abs/2307.09288"},deepseek2024:{authors:["DeepSeek-AI","Liu, A.","Feng, B.","Wang, B.","Wang, B.","Liu, B.","Zhao, C.","Dengr, C.","Ruan, C.","Dai, D.","Guo, D.","Yang, D.","Chen, D.","Ji, D.","Li, E.","Lin, F.","Luo, F.","Hao, G.","Chen, G.","Li, G.","Zhang, H.","Xu, H.","Yang, H.","Zhang, H.","Ding, H.","Xin, H.","Gao, H.","Li, H.","Qu, H.","Cai, J. L.","Liang, J.","Guo, J.","Ni, J.","Li, J.","Chen, J.","Yuan, J.","Qiu, J.","Song, J.","Dong, K.","Gao, K.","Guan, K.","Wang, L.","Zhang, L.","Xu, L.","Xia, L.","Zhao, L.","Zhang, L.","Li, M.","Wang, M.","Zhang, M.","Zhang, M.","Tang, M.","Li, M.","Tian, N.","Huang, P.","Wang, P.","Zhang, P.","Zhu, Q.","Chen, Q.","Du, Q.","Chen, R. J.","Jin, R. L.","Ge, R.","Pan, R.","Xu, R.","Chen, R.","Li, S. S.","Lu, S.","Zhou, S.","Chen, S.","Wu, S.","Ye, S.","Ma, S.","Wang, S.","Zhou, S.","Yu, S.","Zhou, S.","Zheng, S.","Wang, T.","Pei, T.","Yuan, T.","Sun, T.","Xiao, W. L.","Zeng, W.","An, W.","Liu, W.","Liang, W.","Gao, W.","Zhang, W.","Li, X. Q.","Jin, X.","Wang, X.","Bi, X.","Liu, X.","Wang, X.","Shen, X.","Chen, X.","Chen, X.","Nie, X.","Sun, X.","Wang, X.","Liu, X.","Xie, X.","Yu, X.","Song, X.","Zhou, X.","Yang, X.","Lu, X.","Su, X.","Wu, Y.","Li, Y. K.","Wei, Y. X.","Zhu, Y. X.","Xu, Y.","Huang, Y.","Li, Y.","Zhao, Y.","Sun, Y.","Li, Y.","Wang, Y.","Zheng, Y.","Zhang, Y.","Xiong, Y.","Zhao, Y.","He, Y.","Tang, Y.","Piao, Y.","Dong, Y.","Tan, Y.","Liu, Y.","Wang, Y.","Guo, Y.","Zhu, Y.","Wang, Y.","Zou, Y.","Zha, Y.","Ma, Y.","Yan, Y.","You, Y.","Liu, Y.","Ren, Z. Z.","Ren, Z.","Sha, Z.","Fu, Z.","Huang, Z.","Zhang, Z.","Xie, Z.","Hao, Z.","Shao, Z.","Wen, Z.","Xu, Z.","Zhang, Z.","Li, Z.","Wang, Z.","Gu, Z.","Li, Z.","Xie, Z."],year:2024,title:"DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model",eprint:"2405.04434",archivePrefix:"arXiv",primaryClass:"cs.CL",url:"https://arxiv.org/abs/2405.04434"},grattafiori2024:{authors:["Grattafiori, A.","Dubey, A.","Jauhri, A.","Pandey, A.","Kadian, A.","Al-Dahle, A.","Letman, A.","Mathur, A.","Schelten, A.","Vaughan, A.","Yang, A.","Fan, A.","Goyal, A.","Hartshorn, A.","Yang, A.","Mitra, A.","Sravankumar, A.","Korenev, A.","Hinsvark, A.","Rao, A.","Zhang, A.","Rodriguez, A.","Gregerson, A.","Spataru, A.","Roziere, B.","Biron, B.","Tang, B.","Chern, B.","Caucheteux, C.","Nayak, C.","Bi, C.","Marra, C.","McConnell, C.","Keller, C.","Touret, C.","Wu, C.","Wong, C.","Canton Ferrer, C.","Nikolaidis, C.","Allonsius, D.","Song, D.","Pintz, D.","Livshits, D.","Wyatt, D.","Esiobu, D.","Choudhary, D.","Mahajan, D.","Garcia-Olano, D.","Perino, D.","Hupkes, D.","Lakomkin, E.","AlBadawy, E.","Lobanova, E.","Dinan, E.","Smith, E. M.","Radenovic, F.","Guzm\xe1n, F.","Zhang, F.","Synnaeve, G.","Lee, G.","Lewis Anderson, G.","Thattai, G.","Nail, G.","Mialon, G.","Pang, G.","Cucurell, G.","Nguyen, H.","Korevaar, H.","Xu, H.","Touvron, H.","Zarov, I.","Arrieta Ibarra, I.","Kloumann, I.","Misra, I.","Evtimov, I.","Zhang, J.","Copet, J.","Lee, J.","Geffert, J.","Vranes, J.","Park, J.","Mahadeokar, J.","Shah, J.","van der Linde, J.","Billock, J.","Hong, J.","Lee, J.","Fu, J.","Chi, J.","Huang, J.","Liu, J.","Wang, J.","Yu, J.","Bitton, J.","Spisak, J.","Park, J.","Rocca, J.","Johnstun, J.","Saxe, J.","Jia, J.","Alwala, K.","Prasad, K.","Upasani, K.","Plawiak, K.","Li, K.","Heafield, K.","Stone, K.","El-Arini, K.","Iyer, K.","Malik, K.","Chiu, K.","Bhalla, K.","Lakhotia, K.","Rantala-Yeary, L.","van der Maaten, L.","Chen, L.","Tan, L.","Jenkins, L.","Martin, L.","Madaan, L.","Malo, L.","Blecher, L.","Landzaat, L.","de Oliveira, L.","Muzzi, M.","Pasupuleti, M.","Singh, M.","Paluri, M.","Kardas, M.","Tsimpoukelli, M.","Oldham, M.","Rita, M.","Pavlova, M.","Kambadur, M.","Lewis, M.","Si, M.","Singh, M.","Hassan, M.","Goyal, N.","Torabi, N.","Bashlykov, N.","Bogoychev, N.","Chatterji, N.","Zhang, N.","Duchenne, O.","\xc7elebi, O.","Alrassy, P.","Zhang, P.","Li, P.","Vasic, P.","Weng, P.","Bhargava, P.","Dubal, P.","Krishnan, P.","Koura, P. S.","Xu, P.","He, Q.","Dong, Q.","Ganapathy, R.","Calderer, R.","Silveira Cabral, R.","Stojnic, R.","Raileanu, R.","Maheswari, R.","Girdhar, R.","Patel, R.","Sauvestre, R.","Polidoro, R.","Sumbaly, R.","Taylor, R.","Silva, R.","Hou, R.","Wang, R.","Hosseini, S.","Chennabasappa, S.","Singh, S.","Bell, S.","Kim, S. S.","Edunov, S.","Nie, S.","Narang, S.","Raparthy, S.","Shen, S.","Wan, S.","Bhosale, S.","Zhang, S.","Vandenhende, S.","Batra, S.","Whitman, S.","Sootla, S.","Collot, S.","Gururangan, S.","Borodinsky, S.","Herman, T.","Fowler, T.","Sheasha, T.","Georgiou, T.","Scialom, T.","Speckbacher, T.","Mihaylov, T.","Xiao, T.","Karn, U.","Goswami, V.","Gupta, V.","Ramanathan, V.","Kerkez, V.","Gonguet, V.","Do, V.","Vogeti, V.","Albiero, V.","Petrovic, V.","Chu, W.","Xiong, W.","Fu, W.","Meers, W.","Martinet, X.","Wang, X.","Wang, X.","Tan, X. E.","Xia, X.","Xie, X.","Jia, X.","Wang, X.","Goldschlag, Y.","Gaur, Y.","Babaei, Y.","Wen, Y.","Song, Y.","Zhang, Y.","Li, Y.","Mao, Y.","Delpierre Coudert, Z.","Yan, Z.","Chen, Z.","Papakipos, Z.","Singh, A.","Srivastava, A.","Jain, A.","Kelsey, A.","Shajnfeld, A.","Gangidi, A.","Victoria, A.","Goldstand, A.","Menon, A.","Sharma, A.","Boesenberg, A.","Baevski, A.","Feinstein, A.","Kallet, A.","Sangani, A.","Teo, A.","Yunus, A.","Lupu, A.","Alvarado, A.","Caples, A.","Gu, A.","Ho, A.","Poulton, A.","Ryan, A.","Ramchandani, A.","Dong, A.","Franco, A.","Goyal, A.","Saraf, A.","Chowdhury, A.","Gabriel, A.","Bharambe, A.","Eisenman, A.","Yazdan, A.","James, B.","Maurer, B.","Leonhardi, B.","Huang, B.","Loyd, B.","De Paola, B.","Paranjape, B.","Liu, B.","Wu, B.","Ni, B.","Hancock, B.","Wasti, B.","Spence, B.","Stojkovic, B.","Gamido, B.","Montalvo, B.","Parker, C.","Burton, C.","Mejia, C.","Liu, C.","Wang, C.","Kim, C.","Zhou, C.","Hu, C.","Chu, C.","Cai, C.","Tindal, C.","Feichtenhofer, C.","Gao, C.","Civin, D.","Beaty, D.","Kreymer, D.","Li, D.","Adkins, D.","Xu, D.","Testuggine, D.","David, D.","Parikh, D.","Liskovich, D.","Foss, D.","Wang, D.","Le, D.","Holland, D.","Dowling, E.","Jamil, E.","Montgomery, E.","Hahn, E.","Wood, E.","Le, E.","Brinkman, E.","Arcaute, E.","Dunbar, E.","Smothers, E.","Sun, F.","Kreuk, F.","Tian, F.","Kokkinos, F.","Ozgenel, F.","Caggioni, F.","Kanayet, F.","Seide, F.","Medina Florez, G.","Schwarz, G.","Badeer, G.","Swee, G.","Sizov, G.","Zhang, G.","Lakshminarayanan, G.","Inan, H.","Shojanazeri, H.","Zou, H.","Wang, H.","Zha, H.","Habeeb, H.","Rudolph, H.","Suk, H.","Aspegren, H.","Goldman, H.","Zhan, H.","Damlaj, I.","Molybog, I.","Tufanov, I.","Leontiadis, I.","Veliche, I.","Gat, I.","Weissman, J.","Geboski, J.","Kohli, J.","Lam, J.","Asher, J.","Gaya, J.","Marcus, J.","Tang, J.","Chan, J.","Zhen, J.","Reizenstein, J.","Teboul, J.","Yang, J.","Cummings, J.","Carvill, J.","Shepard, J.","McPhie, J.","Torres, J.","Ginsburg, J.","Wang, J.","Wu, K.","U, K.","Saxena, K.","Khandelwal, K.","Zand, K.","Veeraraghavan, K.","Michelena, K.","Li, K.","Jagadeesh, K.","Huang, K.","Chawla, K.","Huang, K.","Chen, L.","Garg, L.","A, L.","Silva, L.","Bell, L.","Zhang, L.","Guo, L.","Yu, L.","Moshkovich, L.","Wehrstedt, L.","Khabsa, M.","Avalani, M.","Bhatt, M.","Mankus, M.","Hasson, M.","Lennie, M.","Reso, M.","Groshev, M.","Naumov, M.","Lathi, M.","Keneally, M.","Liu, M.","Seltzer, M. L.","Valko, M.","Restrepo, M.","Patel, M.","Vyatskov, M.","Samvelyan, M.","Clark, M.","Macey, M.","Wang, M.","Jubert Hermoso, M.","Metanat, M.","Rastegari, M.","Bansal, M.","Santhanam, N.","Parks, N.","White, N.","Bawa, N.","Singhal, N.","Egebo, N.","Usunier, N.","Mehta, N.","Laptev, N. P.","Dong, N.","Cheng, N.","Chernoguz, O.","Hart, O.","Salpekar, O.","Kalinli, O.","Kent, P.","Parekh, P.","Saab, P.","Balaji, P.","Rittner, P.","Bontrager, P.","Roux, P.","Dollar, P.","Zvyagina, P.","Ratanchandani, P.","Yuvraj, P.","Liang, Q.","Alao, R.","Rodriguez, R.","Ayub, R.","Murthy, R.","Nayani, R.","Mitra, R.","Parthasarathy, R.","Li, R.","Hogan, R.","Wang, R.","Howes, R.","Rinott, R.","Mehta, S.","Siby, S.","Bondu, S. J.","Datta, S.","Chugh, S.","Hunt, S.","Dhillon, S.","Sidorov, S.","Pan, S.","Mahajan, S.","Verma, S.","Yamamoto, S.","Lindsay, S.","Lindsay, S.","Feng, S.","Lin, S.","Zha, S. C.","Patil, S.","Shankar, S.","Zhang, S.","Zhang, S.","Wang, S.","Agarwal, S.","Sajuyigbe, S.","Chintala, S.","Max, S.","Chen, S.","Kehoe, S.","Satterfield, S.","Govindaprasad, S.","Gupta, S.","Deng, S.","Cho, S.","Virk, S.","Subramanian, S.","Choudhury, S.","Goldman, S.","Remez, T.","Glaser, T.","Best, T.","Koehler, T.","Robinson, T.","Li, T.","Zhang, T.","Matthews, T.","Chou, T.","Shaked, T.","Vontimitta, V.","Ajayi, V.","Montanez, V.","Mohan, V.","Kumar, V. S.","Mangla, V.","Ionescu, V.","Poenaru, V.","Mihailescu, V. T.","Ivanov, V.","Li, W.","Wang, W.","Jiang, W.","Bouaziz, W.","Constable, W.","Tang, X.","Wu, X.","Wang, X.","Wu, X.","Gao, X.","Kleinman, Y.","Chen, Y.","Hu, Y.","Jia, Y.","Qi, Y.","Li, Y.","Zhang, Y.","Zhang, Y.","Adi, Y.","Nam, Y.","Wang, Y.","Zhao, Y.","Hao, Y.","Qian, Y.","Li, Y.","He, Y.","Rait, Z.","DeVito, Z.","Rosnbrick, Z.","Wen, Z.","Yang, Z.","Zhao, Z.","Ma, Z."],year:2024,title:"The Llama 3 Herd of Models",eprint:"2407.21783",archivePrefix:"arXiv",primaryClass:"cs.AI",url:"https://arxiv.org/abs/2407.21783"},groeneveld2024:{authors:["Groeneveld, D.","Beltagy, I.","Walsh, P.","Bhagia, A.","Kinney, R.","Tafjord, O.","Jha, A. H.","Ivison, H.","Magnusson, I.","Wang, Y.","Arora, S.","Atkinson, D.","Authur, R.","Chandu, K. R.","Cohan, A.","Dumas, J.","Elazar, Y.","Gu, Y.","Hessel, J.","Khot, T.","Merrill, W.","Morrison, J.","Muennighoff, N.","Naik, A.","Nam, C.","Peters, M. E.","Pyatkin, V.","Ravichander, A.","Schwenk, D.","Shah, S.","Smith, W.","Strubell, E.","Subramani, N.","Wortsman, M.","Dasigi, P.","Lambert, N.","Richardson, K.","Zettlemoyer, L.","Dodge, J.","Lo, K.","Soldaini, L.","Smith, N. A.","Hajishirzi, H."],year:2024,title:"OLMo: Accelerating the Science of Language Models",eprint:"2402.00838",archivePrefix:"arXiv",primaryClass:"cs.CL",url:"https://arxiv.org/abs/2402.00838"},singh2024:{authors:["Singh, A. K.","Strouse, D. J."],year:2024,title:"Tokenization counts: the impact of tokenization on arithmetic in frontier LLMs",eprint:"2402.14903",archivePrefix:"arXiv",primaryClass:"cs.CL",url:"https://arxiv.org/abs/2402.14903"},claude2024:{authors:["Buckley, M."],year:2023,title:"Integer tokenization is insane",url:"https://www.beren.io/2024-07-07-Right-to-Left-Integer-Tokenization/"},madaan2024:{authors:["Madaan, L.","Singh, A. K.","Schaeffer, R.","Poulton, A.","Koyejo, S.","Stenetorp, P.","Narang, S.","Hupkes, D."],year:2024,title:"Quantifying Variance in Evaluation Benchmarks",eprint:"2406.10229",archivePrefix:"arXiv",primaryClass:"cs.LG",url:"https://arxiv.org/abs/2406.10229"}},l={"same-tokens-footnote":{text:"This only applies to non-carry additions. For carry additions, the resulting number will be tokenized differently depending on the direction. For example, 999 + 111 = 1110 would be tokenized as [1, 110] in L2R but [111, 0] in R2L."}},n=(0,s.createContext)(null);function o(e){let{children:t}=e,a=Object.keys(i),s=Object.keys(l);return(0,r.jsx)(n.Provider,{value:{citations:i,footnotes:l,getCitationNumber:e=>a.indexOf(e)+1,getFootnoteNumber:e=>s.indexOf(e)+1},children:t})}function d(){let e=(0,s.useContext)(n);if(!e)throw Error("useCitations must be used within CitationProvider");return e}function c(){let e=(0,s.useContext)(n);if(!e)throw Error("useFootnotes must be used within CitationProvider");return e}},21567:(e,t,a)=>{"use strict";a.d(t,{cn:()=>i});var r=a(43463),s=a(69795);function i(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,s.QP)((0,r.$)(t))}},79607:(e,t,a)=>{"use strict";a.d(t,{default:()=>l});var r=a(95155),s=a(12115),i=a(22130);let l=()=>{let[e,t]=(0,s.useState)(null),[a,l]=(0,s.useState)("gpt2"),n={gpt2:[{operation:"add",l2r:.30685,r2l:.31925,l2r_std:.07,r2l_std:.07},{operation:"divide",l2r:.3184,r2l:.29065,l2r_std:.05,r2l_std:.05},{operation:"multiply",l2r:.15735,r2l:.16205,l2r_std:.01,r2l_std:.01},{operation:"subtract",l2r:.1812,r2l:.1737,l2r_std:.07,r2l_std:.075}],olmo:[{operation:"add",l2r:.33585,r2l:.32915,l2r_std:.04,r2l_std:.04},{operation:"divide",l2r:.34545,r2l:.3273,l2r_std:.02,r2l_std:.02},{operation:"multiply",l2r:.1598,r2l:.1611,l2r_std:.004,r2l_std:.004},{operation:"subtract",l2r:.19315,r2l:.22125,l2r_std:.04,r2l_std:.04}]}[a],o=(e,t)=>"".concat(e.toFixed(2)," \xb1 ").concat(t.toFixed(2));return(0,r.jsxs)(i.Zp,{children:[(0,r.jsx)(i.aR,{children:(0,r.jsx)("div",{className:"flex items-center justify-between mb-4 mx-5",children:(0,r.jsxs)("select",{value:a,onChange:e=>l(e.target.value),className:"px-4 py-2 border-2 rounded-md text-sm font-medium bg-white hover:border-blue-500 transition-colors",children:[(0,r.jsx)("option",{value:"gpt2",children:"GPT-2 Tokenizer"}),(0,r.jsx)("option",{value:"olmo",children:"OLMo Tokenizer"})]})})}),(0,r.jsx)(i.Wu,{children:(0,r.jsx)("div",{className:"h-[500px]",children:(0,r.jsxs)("svg",{width:"100%",height:"100%",viewBox:"0 0 600 400",children:[(0,r.jsx)("rect",{x:"60",y:"20",width:"500",height:"320",fill:"#f8f9fc",rx:"4"}),[0,.15,.3,.45].map((e,t)=>(0,r.jsx)("line",{x1:"60",x2:"560",y1:340-e/.45*320,y2:340-e/.45*320,stroke:"#e5e7eb",strokeWidth:"1"},"grid-".concat(t))),(0,r.jsx)("line",{x1:"60",y1:"340",x2:"60",y2:"20",stroke:"#374151",strokeWidth:"1.5"}),[0,.15,.3,.45].map((e,t)=>(0,r.jsxs)("g",{children:[(0,r.jsx)("line",{x1:"55",y1:340-e/.45*320,x2:"65",y2:340-e/.45*320,stroke:"#374151",strokeWidth:"1.5"}),(0,r.jsx)("text",{x:"45",y:345-e/.45*320,textAnchor:"end",fontSize:"12",fill:"#374151",children:e.toFixed(2)})]},t)),(0,r.jsx)("text",{x:"15",y:"200",transform:"rotate(-90, 15, 200)",textAnchor:"middle",fontSize:"12",fill:"#374151",children:"Accuracy"}),(0,r.jsx)("line",{x1:"60",y1:"340",x2:"560",y2:"340",stroke:"#374151",strokeWidth:"1.5"}),n.map((e,t)=>(0,r.jsx)("text",{x:126+125*t,y:"365",textAnchor:"middle",fontSize:"12",fill:"#374151",children:e.operation},t)),(0,r.jsx)("text",{x:"310",y:"390",textAnchor:"middle",fontSize:"12",fill:"#374151",children:"Operator"}),n.map((a,s)=>{let i=a.l2r/.45*320,l=a.r2l/.45*320,n=Math.min(340-i,340-l)-25;return(0,r.jsxs)("g",{children:[(0,r.jsxs)("g",{onMouseEnter:()=>t("l2r-".concat(s)),onMouseLeave:()=>t(null),style:{cursor:"pointer"},children:[(0,r.jsx)("rect",{x:85+125*s,y:340-i,width:"40",height:i,fill:e==="l2r-".concat(s)?"#ff7777":"#ff9999",opacity:"0.8"}),e==="l2r-".concat(s)&&(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{x:75+125*s,y:n-15,width:"70",height:"20",fill:"white",stroke:"#374151",strokeWidth:"1",rx:"4"}),(0,r.jsx)("text",{x:110+125*s,y:n,textAnchor:"middle",fontSize:"12",fill:"#374151",children:o(a.l2r,a.l2r_std)})]})]}),(0,r.jsx)("line",{x1:105+125*s,y1:340-(a.l2r+a.l2r_std)/.45*320,x2:105+125*s,y2:340-(a.l2r-a.l2r_std)/.45*320,stroke:"#374151",strokeWidth:"1.5"}),(0,r.jsx)("line",{x1:95+125*s,x2:115+125*s,y1:340-(a.l2r+a.l2r_std)/.45*320,y2:340-(a.l2r+a.l2r_std)/.45*320,stroke:"#374151",strokeWidth:"1.5"}),(0,r.jsx)("line",{x1:95+125*s,x2:115+125*s,y1:340-(a.l2r-a.l2r_std)/.45*320,y2:340-(a.l2r-a.l2r_std)/.45*320,stroke:"#374151",strokeWidth:"1.5"}),(0,r.jsxs)("g",{onMouseEnter:()=>t("r2l-".concat(s)),onMouseLeave:()=>t(null),style:{cursor:"pointer"},children:[(0,r.jsx)("rect",{x:130+125*s,y:340-l,width:"40",height:l,fill:e==="r2l-".concat(s)?"#77d4d4":"#99e6e6",opacity:"0.8"}),e==="r2l-".concat(s)&&(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{x:120+125*s,y:n-15,width:"70",height:"20",fill:"white",stroke:"#374151",strokeWidth:"1",rx:"4"}),(0,r.jsx)("text",{x:155+125*s,y:n,textAnchor:"middle",fontSize:"12",fill:"#374151",children:o(a.r2l,a.r2l_std)})]})]}),(0,r.jsx)("line",{x1:150+125*s,y1:340-(a.r2l+a.r2l_std)/.45*320,x2:150+125*s,y2:340-(a.r2l-a.r2l_std)/.45*320,stroke:"#374151",strokeWidth:"1.5"}),(0,r.jsx)("line",{x1:140+125*s,x2:160+125*s,y1:340-(a.r2l+a.r2l_std)/.45*320,y2:340-(a.r2l+a.r2l_std)/.45*320,stroke:"#374151",strokeWidth:"1.5"}),(0,r.jsx)("line",{x1:140+125*s,x2:160+125*s,y1:340-(a.r2l-a.r2l_std)/.45*320,y2:340-(a.r2l-a.r2l_std)/.45*320,stroke:"#374151",strokeWidth:"1.5"})]},s)}),(0,r.jsxs)("g",{transform:"translate(450, 50)",children:[(0,r.jsx)("rect",{width:"15",height:"15",fill:"#ff9999"}),(0,r.jsx)("text",{x:"20",y:"12",fontSize:"12",fill:"#374151",children:"Left-to-Right "}),(0,r.jsx)("rect",{y:"20",width:"15",height:"15",fill:"#99e6e6"}),(0,r.jsx)("text",{x:"20",y:"32",fontSize:"12",fill:"#374151",children:"Right-to-Left"})]})]})})})]})}},5180:(e,t,a)=>{"use strict";a.d(t,{default:()=>l});var r=a(95155),s=a(12115),i=a(22130);let l=()=>{let[e,t]=(0,s.useState)("GPT2 Tokenizer Model"),[a,l]=(0,s.useState)(null),[n,o]=(0,s.useState)(null),d=[.82,.79,.85,.77];return(0,r.jsx)(i.Zp,{className:"w-full px-4",children:(0,r.jsxs)(i.Wu,{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"py-4",children:[(0,r.jsx)("p",{className:"responsive-text-sm text-muted-foreground mb-2",children:"Select model with highest standard deviation across evals"}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2",children:["L2R Tokenizer Model","R2L Tokenizer Model","GPT2 Tokenizer Model"].map((a,s)=>(0,r.jsxs)("div",{onClick:()=>t(a),className:"border rounded-md p-2 flex flex-col items-center justify-center min-h-[60px] cursor-pointer transition-all hover:scale-[1.02] active:scale-[0.98] ".concat(a===e?"border-2 border-blue-500 bg-blue-50/50":"hover:bg-gray-50"),children:[(0,r.jsx)("div",{className:"responsive-text-sm text-muted-foreground text-center",children:a}),(0,r.jsxs)("div",{className:"responsive-text-sm text-muted-foreground mt-1",children:["σ = \xb1",(.02+.01*s).toFixed(3)]}),a===e&&(0,r.jsx)("div",{className:"responsive-text-xs text-blue-500 mt-0.5",children:"Highest variation"})]},s))})]}),(0,r.jsxs)("div",{className:"py-4",children:[(0,r.jsx)("p",{className:"text-xs text-muted-foreground mb-2",children:"Train same model with different random seeds"}),(0,r.jsx)("div",{className:"grid grid-cols-4 gap-2",children:[1,2,3,4].map(t=>(0,r.jsxs)("div",{onMouseEnter:()=>l(t),onMouseLeave:()=>l(null),className:"border rounded-md p-2 flex flex-col items-center justify-center h-[60px] transition-all hover:scale-105 ".concat(a===t?"shadow-md":""," ").concat(1===t?"bg-blue-50":2===t?"bg-green-50":3===t?"bg-yellow-50":"bg-red-50"),children:[(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:e}),(0,r.jsxs)("div",{className:"text-xs text-muted-foreground mt-1",children:["Seed ",t]})]},t))})]}),(0,r.jsxs)("div",{className:"py-4",children:[(0,r.jsxs)("p",{className:"text-xs text-muted-foreground mb-2",children:[(0,r.jsx)("strong",{children:"For each task, "})," evaluate all models"]}),(0,r.jsx)("div",{className:"space-y-1",children:["A","B","..."].map((e,t)=>(0,r.jsxs)("div",{onMouseEnter:()=>o(e),onMouseLeave:()=>o(null),className:"grid grid-cols-5 gap-2 transition-transform hover:translate-x-1",children:[(0,r.jsx)("div",{className:"flex items-center justify-center h-[40px]",children:(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:["Task ",e]})}),d.map((a,s)=>(0,r.jsx)("div",{className:"rounded-md p-2 flex items-center justify-center h-[40px] transition-transform hover:scale-105 ".concat(n===e?"shadow-sm":""," ").concat(0===s?"bg-blue-50":1===s?"bg-green-50":2===s?"bg-yellow-50":"bg-red-50"),children:(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:"..."===e?"...":0===t?a.toFixed(2):(.87*a).toFixed(2)})},s))]},e))})]}),(0,r.jsxs)("div",{className:"py-4",children:[(0,r.jsx)("p",{className:"text-xs text-muted-foreground mb-2",children:"Calculate task-specific standard deviations"}),(0,r.jsx)("div",{className:"space-y-1",children:["A","B","..."].map(e=>(0,r.jsxs)("div",{className:"grid grid-cols-5 gap-2 transition-transform hover:translate-x-1",children:[(0,r.jsx)("div",{className:"flex items-center justify-center h-[40px]",children:(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:["Task ",e]})}),(0,r.jsx)("div",{className:"col-span-4 rounded-md p-2 flex items-center justify-center h-[40px] bg-blue-50 transition-transform hover:scale-[1.02]",children:(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:"..."===e?"...":"σ = \xb1".concat(("A"===e?.034:.0299).toFixed(3))})})]},e))})]}),(0,r.jsxs)("p",{className:"py-4 text-xs text-muted-foreground italic",children:["For task A, we report σ = 0.034 as the standard deviation for ",(0,r.jsx)("strong",{children:"all models"})]})]})})}},94388:(e,t,a)=>{"use strict";a.d(t,{default:()=>l});var r=a(95155),s=a(12115),i=a(22130);let l=()=>{let[e,t]=(0,s.useState)(null);return(0,r.jsxs)(i.Zp,{className:"w-full max-w-2xl",children:[(0,r.jsx)(i.aR,{children:(0,r.jsx)(i.ZB,{className:"text-center",children:"Average Accuracy in Addition Tasks"})}),(0,r.jsx)(i.Wu,{children:(0,r.jsxs)("div",{className:"h-80 w-full relative",children:[(0,r.jsx)("div",{className:"absolute -left-16 top-1/2 -rotate-90 text-sm text-gray-500 -translate-y-1/2",children:"Accuracy"}),(0,r.jsx)("div",{className:"h-full flex items-end justify-around",children:[{name:"Base Llama 3\nTokenizer",value:.699},{name:"Right-to-Left",value:.791}].map(a=>(0,r.jsxs)("div",{className:"flex flex-col items-center",children:[(0,r.jsx)("div",{className:"w-20 rounded-t-sm transition-all duration-200 ".concat(e===a.name?"bg-indigo-400 scale-105":"bg-indigo-600"),style:{height:"".concat((a.value-.6)/(.8-.6)*300,"px")},onMouseEnter:()=>t(a.name),onMouseLeave:()=>t(null),children:(0,r.jsx)("div",{className:"text-white text-center mt-2 transition-opacity duration-200 ".concat(e===a.name?"opacity-100":"opacity-80"),children:a.value.toFixed(3)})}),(0,r.jsx)("div",{className:"mt-4 text-sm text-center whitespace-nowrap transition-all duration-200 ".concat(e===a.name?"font-bold scale-105":""),children:a.name})]},a.name))})]})})]})}},96305:(e,t,a)=>{"use strict";a.d(t,{default:()=>l});var r=a(95155),s=a(12115),i=a(22130);let l=()=>{let e=Array.from({length:20},(e,t)=>50*t+1),t=e=>new Set(["521","527","531","532","534","539","541","542","543","547","564","566","567","569","611","619","621","622","624","631","632","633","634","636","637","638","639","664","711","715","716","717","719","721","722","723","724","726","731","732","734","735","737","738","739","741","742","743","744","746","749","761","764","766","769","788","791","811","812","813","814","816","817","818","819","821","822","823","824","826","827","828","829","831","832","834","835","836","837","838","839","841","842","843","844","845","846","847","848","849","851","852","853","854","856","857","858","859","861","862","863","865","867","868","869","871","872","873","874","876","878","879","881","890","891","892","894","895","897","898","902","903","904","906","907","908","912","913","914","917","918","919","921","922","923","924","926","927","928","929","931","932","933","934","935","936","937","938","939","941","942","943","944","945","946","947","948","955","957","958","959","961","962","963","964","965","966","967","971","972","973","974","976","977","979","981","982","983","984","988","991"]).has(e.toString())?"bg-red-200":"bg-green-200";return(0,r.jsxs)(i.Zp,{className:"w-full max-w-[1200px] p-2 sm:p-4 bg-white",children:[(0,r.jsx)(i.aR,{children:(0,r.jsx)(i.ZB,{className:"text-lg sm:text-xl font-semibold text-center",children:"BPE (GPT2) Tokenization Heatmap for Numbers 1-1000"})}),(0,r.jsxs)(i.Wu,{children:[(0,r.jsxs)("div",{className:"flex flex-wrap justify-center gap-2 sm:gap-4 mb-2 sm:mb-4",children:[(0,r.jsx)("div",{className:"flex items-center gap-1 sm:gap-2",children:(0,r.jsx)("span",{className:"text-[10px] sm:text-xs",children:"This number consists of "})}),(0,r.jsxs)("div",{className:"flex items-center gap-1 sm:gap-2",children:[(0,r.jsx)("div",{className:"w-3 h-3 sm:w-4 sm:h-4 bg-green-200"}),(0,r.jsx)("span",{className:"text-[10px] sm:text-xs",children:"1 token"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1 sm:gap-2",children:[(0,r.jsx)("div",{className:"w-3 h-3 sm:w-4 sm:h-4 bg-red-200"}),(0,r.jsx)("span",{className:"text-[10px] sm:text-xs",children:"2 tokens"})]})]}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsx)("div",{className:"min-w-[300px] text-xs sm:min-w-[600px] sm:text-sm",children:(0,r.jsx)("div",{className:"grid",style:{gridTemplateColumns:"repeat(50, 22px)"},children:e.map(e=>(0,r.jsx)(s.Fragment,{children:Array.from({length:50},(a,s)=>{let i=e+s;return(0,r.jsx)("div",{className:"w-4 h-4 sm:w-6 sm:h-6 border border-gray-100 ".concat(t(i)," flex items-center justify-center"),children:(0,r.jsx)("span",{className:"text-[6px] sm:text-[8px] md:text-[8px] font-bold",children:i})},"cell-".concat(i))})},"row-".concat(e)))})})})]})]})}},10944:(e,t,a)=>{"use strict";a.d(t,{default:()=>n});var r=a(95155),s=a(12115),i=a(22130);let l={MAWPS:{GPT2:[.003,.014,.042,.076,.087,.121,.135,.155,.166,.203,.234,.217,.237,.234,.251,.265,.27,.299,.282,.296,.287,.293,.335,.33,.327,.307,.335,.315,.33,.321],OLMo:[0,.028,.034,.048,.085,.101,.096,.138,.163,.177,.192,.189,.248,.245,.259,.287,.276,.293,.338,.287,.315,.346,.338,.341,.335,.349,.361,.341,.369,.361],Llama3:[0,.034,.062,.068,.115,.135,.158,.172,.172,.228,.186,.248,.254,.299,.282,.332,.31,.327,.341,.33,.349,.352,.335,.383,.383,.369,.392,.392,.406,.394],"Llama3 R2L":[0,.025,.059,.076,.096,.115,.13,.155,.144,.203,.231,.268,.239,.242,.245,.273,.273,.282,.293,.304,.318,.335,.33,.335,.346,.361,.344,.355,.355,.361],DeepSeek:[0,.042,.037,.051,.082,.127,.161,.166,.189,.214,.234,.268,.254,.27,.301,.346,.31,.301,.344,.349,.358,.341,.355,.344,.363,.358,.372,.352,.377,.358]},SVAMP:{GPT2:[0,.02,.055,.06,.065,.09,.13,.115,.14,.115,.14,.13,.16,.16,.16,.15,.2,.2,.205,.2,.22,.185,.205,.185,.245,.22,.215,.175,.205,.205],OLMo:[0,.025,.05,.04,.08,.095,.1,.14,.135,.12,.135,.14,.17,.14,.17,.17,.185,.175,.195,.235,.2,.235,.22,.195,.225,.235,.23,.215,.225,.23],Llama3:[.005,.02,.03,.055,.085,.095,.09,.105,.115,.135,.15,.135,.165,.18,.185,.215,.25,.195,.225,.205,.2,.22,.205,.21,.24,.22,.255,.225,.235,.27],"Llama3 R2L":[0,.025,.035,.06,.06,.105,.12,.13,.135,.16,.155,.165,.155,.2,.195,.215,.25,.21,.225,.235,.205,.27,.255,.22,.285,.225,.26,.25,.26,.265],DeepSeek:[0,.01,.02,.06,.08,.105,.1,.135,.165,.17,.12,.16,.185,.165,.19,.17,.185,.205,.185,.205,.22,.22,.19,.21,.23,.2,.2,.23,.23,.265]}},n=()=>{let[e,t]=(0,s.useState)("MAWPS"),[a,n]=(0,s.useState)(null),[o,d]=(0,s.useState)(null),[c,h]=(0,s.useState)(new Set([])),x=Object.entries(l[e]).map(e=>{let[t,a]=e;return{label:t,values:a,color:({GPT2:"rgb(255, 99, 132)",OLMo:"rgb(53, 162, 235)",Llama3:"rgb(75, 192, 192)","Llama3 R2L":"rgb(153, 102, 255)",DeepSeek:"rgb(255, 159, 64)"})[t]}}),m=Math.max(...x.flatMap(e=>e.values)),u=e=>Math.min(740,Math.max(60,60+e/29*680)),g=e=>Math.min(340,Math.max(60,340-e/m*280)),p=e=>e.map((e,t)=>"".concat(0===t?"M":"L"," ").concat(u(t)," ").concat(g(e))).join(" "),f=Array.from({length:15},(e,t)=>2*t),y=e=>{let t=new Set(c);t.has(e)?t.delete(e):t.add(e),h(t)};return(0,r.jsxs)(i.Zp,{className:"w-full max-w-5xl",children:[(0,r.jsxs)(i.aR,{children:[(0,r.jsx)("div",{className:"flex items-center justify-center",children:(0,r.jsxs)("select",{className:"border rounded p-1",value:e,onChange:e=>t(e.target.value),children:[(0,r.jsx)("option",{value:"MAWPS",children:"MAWPS"}),(0,r.jsx)("option",{value:"SVAMP",children:"SVAMP"})]})}),(0,r.jsx)("div",{className:"text-gray-500 text-center",children:"Evaluated on 5-shot problems; Quasi-Exact Match (Accuracy)"})]}),(0,r.jsx)(i.Wu,{children:(0,r.jsxs)("svg",{width:800,height:400,children:[(0,r.jsx)("line",{x1:60,y1:340,x2:740,y2:340,stroke:"black"}),(0,r.jsx)("line",{x1:60,y1:60,x2:60,y2:340,stroke:"black"}),f.map(e=>(0,r.jsxs)("g",{transform:"translate(".concat(u(e),", ").concat(340,")"),children:[(0,r.jsx)("line",{y2:"6",stroke:"black"}),(0,r.jsxs)("text",{y:"20",textAnchor:"middle",children:[2*e,"k"]})]},e)),x.map((e,t)=>!c.has(e.label)&&(0,r.jsxs)("g",{children:[(0,r.jsx)("path",{d:p(e.values),stroke:e.color,fill:"none",strokeWidth:a===e.label?3:2,opacity:null===a||a===e.label?1:.3,onMouseEnter:()=>n(e.label),onMouseLeave:()=>n(null)}),null!==o&&(0,r.jsx)("circle",{cx:u(o),cy:g(e.values[o]),r:4,fill:e.color})]},t)),x.map((e,t)=>(0,r.jsxs)("g",{transform:"translate(".concat(70+120*t,", ").concat(30,")"),style:{cursor:"pointer"},opacity:c.has(e.label)||null!==a&&a!==e.label?.3:1,onMouseEnter:()=>n(e.label),onMouseLeave:()=>n(null),onClick:()=>y(e.label),children:[(0,r.jsx)("line",{x1:0,y1:0,x2:20,y2:0,stroke:e.color,strokeWidth:2}),(0,r.jsx)("text",{x:25,y:4,fontSize:12,children:e.label})]},t)),(0,r.jsx)("text",{x:400,y:395,textAnchor:"middle",children:"Training Steps"}),(0,r.jsx)("text",{transform:"rotate(-90) translate(-".concat(200,", 25)"),textAnchor:"middle",children:"Quasi-Exact Match (Accuracy)"}),null!==o&&(0,r.jsx)("g",{transform:"translate(".concat(Math.min(610,Math.max(60,u(o))),",").concat(Math.min(340-(12+12*x.filter(e=>!c.has(e.label)).length),Math.max(60,Math.min(...x.filter(e=>!c.has(e.label)).map(e=>g(e.values[o])))-15)),")"),children:(()=>{let e=x.filter(e=>!c.has(e.label)),t=[(0,r.jsxs)("text",{x:70,y:0,textAnchor:"middle",fontWeight:"bold",fontSize:11,children:[2*o,"k steps"]},"header"),...e.map((e,t)=>(0,r.jsxs)("text",{x:70,y:18+12*t,textAnchor:"middle",fill:e.color,fontSize:11,children:[e.label,": ",e.values[o].toFixed(3)]},t+1))],a=Math.max(...t.map(e=>6.5*e.props.children.toString().length))+5,s=25+12*e.length;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",{x:10,y:-12,width:a,height:s,rx:4,fill:"white",stroke:"black",strokeWidth:.5,opacity:.95}),t]})})()}),(0,r.jsx)("rect",{x:60,y:60,width:680,height:280,fill:"transparent",onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect(),a=Math.round((e.clientX-t.left)/680*29);a>=0&&a<30&&d(a)},onMouseLeave:()=>d(null)})]})})]})}},52107:(e,t,a)=>{"use strict";a.d(t,{default:()=>l});var r=a(95155),s=a(12115),i=a(22130);let l=()=>{let[e,t]=(0,s.useState)(null),a=[{operation:"add",l2r:.37,r2l:.4,l2r_std:.04,r2l_std:.03},{operation:"divide",l2r:.31,r2l:.35,l2r_std:.02,r2l_std:.02},{operation:"multiply",l2r:.17,r2l:.17,l2r_std:.01,r2l_std:.01},{operation:"subtract",l2r:.19,r2l:.23,l2r_std:.03,r2l_std:.03}],l=(e,t)=>"".concat(e.toFixed(2)," \xb1 ").concat(t.toFixed(2));return(0,r.jsxs)(i.Zp,{children:[(0,r.jsx)(i.aR,{}),(0,r.jsx)(i.Wu,{children:(0,r.jsx)("div",{className:"h-[500px]",children:(0,r.jsxs)("svg",{width:"100%",height:"100%",viewBox:"0 0 600 400",children:[(0,r.jsx)("rect",{x:"60",y:"20",width:"500",height:"320",fill:"#f8f9fc",rx:"4"}),[0,.15,.3,.45].map((e,t)=>(0,r.jsx)("line",{x1:"60",x2:"560",y1:340-e/.45*320,y2:340-e/.45*320,stroke:"#e5e7eb",strokeWidth:"1"},"grid-".concat(t))),(0,r.jsx)("line",{x1:"60",y1:"340",x2:"60",y2:"20",stroke:"#374151",strokeWidth:"1.5"}),[0,.15,.3,.45].map((e,t)=>(0,r.jsxs)("g",{children:[(0,r.jsx)("line",{x1:"55",y1:340-e/.45*320,x2:"65",y2:340-e/.45*320,stroke:"#374151",strokeWidth:"1.5"}),(0,r.jsx)("text",{x:"45",y:345-e/.45*320,textAnchor:"end",fontSize:"12",fill:"#374151",children:e.toFixed(2)})]},t)),(0,r.jsx)("text",{x:"15",y:"200",transform:"rotate(-90, 15, 200)",textAnchor:"middle",fontSize:"12",fill:"#374151",children:"Accuracy"}),(0,r.jsx)("line",{x1:"60",y1:"340",x2:"560",y2:"340",stroke:"#374151",strokeWidth:"1.5"}),a.map((e,t)=>(0,r.jsx)("text",{x:126+125*t,y:"365",textAnchor:"middle",fontSize:"12",fill:"#374151",children:e.operation},t)),(0,r.jsx)("text",{x:"310",y:"390",textAnchor:"middle",fontSize:"12",fill:"#374151",children:"Operator"}),a.map((a,s)=>{let i=a.l2r/.45*320,n=a.r2l/.45*320,o=Math.min(340-i,340-n)-25;return(0,r.jsxs)("g",{children:[(0,r.jsxs)("g",{onMouseEnter:()=>t("l2r-".concat(s)),onMouseLeave:()=>t(null),style:{cursor:"pointer"},children:[(0,r.jsx)("rect",{x:85+125*s,y:340-i,width:"40",height:i,fill:e==="l2r-".concat(s)?"#ff7777":"#ff9999",opacity:"0.8"}),e==="l2r-".concat(s)&&(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{x:75+125*s,y:o-15,width:"70",height:"20",fill:"white",stroke:"#374151",strokeWidth:"1",rx:"4"}),(0,r.jsx)("text",{x:110+125*s,y:o,textAnchor:"middle",fontSize:"12",fill:"#374151",children:l(a.l2r,a.l2r_std)})]})]}),(0,r.jsx)("line",{x1:105+125*s,y1:340-(a.l2r+a.l2r_std)/.45*320,x2:105+125*s,y2:340-(a.l2r-a.l2r_std)/.45*320,stroke:"#374151",strokeWidth:"1.5"}),(0,r.jsx)("line",{x1:95+125*s,x2:115+125*s,y1:340-(a.l2r+a.l2r_std)/.45*320,y2:340-(a.l2r+a.l2r_std)/.45*320,stroke:"#374151",strokeWidth:"1.5"}),(0,r.jsx)("line",{x1:95+125*s,x2:115+125*s,y1:340-(a.l2r-a.l2r_std)/.45*320,y2:340-(a.l2r-a.l2r_std)/.45*320,stroke:"#374151",strokeWidth:"1.5"}),(0,r.jsxs)("g",{onMouseEnter:()=>t("r2l-".concat(s)),onMouseLeave:()=>t(null),style:{cursor:"pointer"},children:[(0,r.jsx)("rect",{x:130+125*s,y:340-n,width:"40",height:n,fill:e==="r2l-".concat(s)?"#77d4d4":"#99e6e6",opacity:"0.8"}),e==="r2l-".concat(s)&&(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{x:120+125*s,y:o-15,width:"70",height:"20",fill:"white",stroke:"#374151",strokeWidth:"1",rx:"4"}),(0,r.jsx)("text",{x:155+125*s,y:o,textAnchor:"middle",fontSize:"12",fill:"#374151",children:l(a.r2l,a.r2l_std)})]})]}),(0,r.jsx)("line",{x1:150+125*s,y1:340-(a.r2l+a.r2l_std)/.45*320,x2:150+125*s,y2:340-(a.r2l-a.r2l_std)/.45*320,stroke:"#374151",strokeWidth:"1.5"}),(0,r.jsx)("line",{x1:140+125*s,x2:160+125*s,y1:340-(a.r2l+a.r2l_std)/.45*320,y2:340-(a.r2l+a.r2l_std)/.45*320,stroke:"#374151",strokeWidth:"1.5"}),(0,r.jsx)("line",{x1:140+125*s,x2:160+125*s,y1:340-(a.r2l-a.r2l_std)/.45*320,y2:340-(a.r2l-a.r2l_std)/.45*320,stroke:"#374151",strokeWidth:"1.5"})]},s)}),(0,r.jsxs)("g",{transform:"translate(450, 50)",children:[(0,r.jsx)("rect",{width:"15",height:"15",fill:"#ff9999"}),(0,r.jsx)("text",{x:"20",y:"12",fontSize:"12",fill:"#374151",children:"Left-to-Right "}),(0,r.jsx)("rect",{y:"20",width:"15",height:"15",fill:"#99e6e6"}),(0,r.jsx)("text",{x:"20",y:"32",fontSize:"12",fill:"#374151",children:"Right-to-Left"})]})]})})})]})}},15467:(e,t,a)=>{"use strict";a.d(t,{default:()=>g});var r=a(95155),s=a(12115),i=a(22130),l=a(58581),n=a(24817),o=a(15255),d=a(12800),c=a(66963),h=a(27112),x=a(86354),m=a(16161);let u=[{digits:1,l2r:1,r2l:1,l2r_carry:1,r2l_carry:1},{digits:2,l2r:1,r2l:1,l2r_carry:1,r2l_carry:1},{digits:3,l2r:1,r2l:1,l2r_carry:1,r2l_carry:.886},{digits:4,l2r:.942,r2l:.922,l2r_carry:.974,r2l_carry:.941},{digits:5,l2r:.95,r2l:.939,l2r_carry:.953,r2l_carry:.981},{digits:6,l2r:.959,r2l:.959,l2r_carry:.951,r2l_carry:.719},{digits:7,l2r:.871,r2l:.906,l2r_carry:.829,r2l_carry:.867},{digits:8,l2r:.922,r2l:.93,l2r_carry:.782,r2l_carry:.964},{digits:9,l2r:.956,r2l:.956,l2r_carry:.837,r2l_carry:.6},{digits:10,l2r:.828,r2l:.857,l2r_carry:.275,r2l_carry:.8},{digits:11,l2r:.859,r2l:.893,l2r_carry:.638,r2l_carry:.905},{digits:12,l2r:.886,r2l:.886,l2r_carry:.707,r2l_carry:.662},{digits:13,l2r:.761,r2l:.808,l2r_carry:.218,r2l_carry:.74},{digits:14,l2r:.748,r2l:.814,l2r_carry:.382,r2l_carry:.824},{digits:15,l2r:.762,r2l:.762,l2r_carry:.439,r2l_carry:.448},{digits:16,l2r:.483,r2l:.695,l2r_carry:.286,r2l_carry:.654},{digits:17,l2r:.485,r2l:.683,l2r_carry:.278,r2l_carry:.692},{digits:18,l2r:.484,r2l:.484,l2r_carry:.291,r2l_carry:.144},{digits:19,l2r:.474,r2l:.59,l2r_carry:.151,r2l_carry:.548},{digits:20,l2r:.446,r2l:.583,l2r_carry:.171,r2l_carry:.578}],g=()=>{let[e,t]=(0,s.useState)({l2r:!0,r2l:!0,l2r_carry:!1,r2l_carry:!1}),a=e=>{t(t=>({...t,[e]:!t[e]}))};return(0,r.jsxs)(i.Zp,{className:"w-full max-w-4xl mx-auto",children:[(0,r.jsxs)(i.aR,{children:[(0,r.jsx)(i.ZB,{className:"text-xl font-bold text-center",children:"R2L Tokenization achieves better performance in addition tasks"}),(0,r.jsx)("div",{className:"flex justify-center mt-4",children:(0,r.jsxs)("div",{className:"flex flex-wrap gap-2 p-1 bg-muted/20 rounded-lg",children:[(0,r.jsx)("button",{onClick:()=>a("l2r"),className:"px-4 py-1.5 text-sm font-medium rounded-md transition-all duration-200 ease-out transform hover:scale-105 active:scale-95 ".concat(e.l2r?"bg-primary text-primary-foreground shadow-md":"bg-background/80 text-muted-foreground hover:bg-background"),children:"L2R"}),(0,r.jsx)("button",{onClick:()=>a("r2l"),className:"px-4 py-1.5 text-sm font-medium rounded-md transition-all duration-200 ease-out transform hover:scale-105 active:scale-95 ".concat(e.r2l?"bg-primary text-primary-foreground shadow-md":"bg-background/80 text-muted-foreground hover:bg-background"),children:"R2L"}),(0,r.jsx)("button",{onClick:()=>a("l2r_carry"),className:"px-4 py-1.5 text-sm font-medium rounded-md transition-all duration-200 ease-out transform hover:scale-105 active:scale-95 ".concat(e.l2r_carry?"bg-primary text-primary-foreground shadow-md":"bg-background/80 text-muted-foreground hover:bg-background"),children:"L2R Carry"}),(0,r.jsx)("button",{onClick:()=>a("r2l_carry"),className:"px-4 py-1.5 text-sm font-medium rounded-md transition-all duration-200 ease-out transform hover:scale-105 active:scale-95 ".concat(e.r2l_carry?"bg-primary text-primary-foreground shadow-md":"bg-background/80 text-muted-foreground hover:bg-background"),children:"R2L Carry"})]})})]}),(0,r.jsx)(i.Wu,{children:(0,r.jsx)(l.u,{width:"100%",height:500,children:(0,r.jsxs)(n.b,{data:u,margin:{top:20,right:30,left:20,bottom:10},children:[(0,r.jsx)(o.d,{strokeDasharray:"3 3"}),(0,r.jsx)(d.W,{dataKey:"digits",label:{value:"Digits",position:"insideBottomRight",offset:-10}}),(0,r.jsx)(c.h,{label:{value:"Accuracy",angle:-90,position:"insideLeft"},domain:[0,1]}),(0,r.jsx)(h.m,{}),(0,r.jsx)(x.s,{iconSize:12,wrapperStyle:{fontSize:"12px",paddingTop:"10px"}}),e.l2r&&(0,r.jsx)(m.N,{type:"monotone",dataKey:"l2r",name:"Left to Right Without Carry",stroke:"hsl(var(--chart-1))",activeDot:{r:8}}),e.r2l&&(0,r.jsx)(m.N,{type:"monotone",dataKey:"r2l",name:"Right to Left Without Carry",stroke:"hsl(var(--chart-2))",activeDot:{r:8}}),e.l2r_carry&&(0,r.jsx)(m.N,{type:"monotone",dataKey:"l2r_carry",name:"Left to Right with Carry",stroke:"hsl(var(--chart-3))",activeDot:{r:8}}),e.r2l_carry&&(0,r.jsx)(m.N,{type:"monotone",dataKey:"r2l_carry",name:"Right to Left with Carry",stroke:"hsl(var(--chart-4))",activeDot:{r:8}})]})})})]})}},50193:(e,t,a)=>{"use strict";a.d(t,{default:()=>i});var r=a(95155);a(12115);var s=a(22130);let i=()=>(0,r.jsx)(s.Zp,{className:"w-{3/4} max-w-4xl pt-8 px-2 bg-gradient-to-br from-background to-muted/20 mx-2",children:(0,r.jsx)(s.Wu,{className:"flex flex-col items-center",children:[{problem:"3789 + 8791 = 12580",l2r:{steps:[{tokens:["378","9"],highlight:"9"},{tokens:["879","1"],highlight:"1"},{tokens:["125","80"],highlight:"80"}]},r2l:{steps:[{tokens:["3","789"],highlight:"789"},{tokens:["8","791"],highlight:"791"},{tokens:["12","580"],highlight:"580"}]}}].map(e=>(0,r.jsxs)("div",{className:"w-full",children:[(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-8 max-w-3xl mx-auto",children:[{title:"Left-to-Right Tokenization",steps:e.l2r.steps,color:"red"},{title:"Right-to-Left Tokenization",steps:e.r2l.steps,color:"teal"}].map(e=>{let{title:t,steps:a,color:s}=e;return(0,r.jsxs)("div",{className:"border rounded-lg p-4 md:p-8 bg-white/50 transition-all duration-200 hover:shadow-lg hover:scale-[1.02]",children:[(0,r.jsx)("p",{className:"text-lg md:text-xl font-bold mb-4 md:mb-6 text-center tracking-wide",children:t.toLowerCase()}),(0,r.jsxs)("div",{className:"font-mono flex flex-col items-center text-base md:text-lg",children:[(0,r.jsx)("div",{className:"flex flex-col items-center border-b border-gray-300 pb-1 mb-3 w-full md:w-1/2",children:a.slice(0,-1).map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center space-x-2 mb-2",children:[1===t&&(0,r.jsx)("span",{className:"text-gray-500",children:"\xa0"}),(0,r.jsx)("span",{className:"bg-gray-100 px-2 py-1 transition-colors duration-200 hover:bg-gray-200",children:e.tokens[0]}),(0,r.jsx)("span",{className:"bg-".concat(s,"-100 px-2 py-1 transition-colors duration-200 hover:bg-").concat(s,"-200"),children:e.highlight}),1===t&&(0,r.jsx)("span",{className:"text-gray-500",children:"+"})]},t))}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)("span",{className:"bg-gray-100 px-2 py-1 transition-colors duration-200 hover:bg-gray-200",children:a[2].tokens[0]}),(0,r.jsx)("span",{className:"bg-".concat(s,"-100 px-2 py-1 transition-colors duration-200 hover:bg-").concat(s,"-200"),children:a[2].highlight})]})]})]},t)})}),(0,r.jsxs)("p",{className:"text-sm md:text-base text-gray-600 mt-5 max-w-3xl mx-auto leading-relaxed bg-white/50 rounded-lg",children:["In the L2R example, ",(0,r.jsx)("span",{className:"text-red-600",children:"9"})," + ",(0,r.jsx)("span",{className:"text-red-600",children:"1"})," should map to the digit ",(0,r.jsx)("span",{className:"text-red-600",children:"0"})," but ends up grouped together with ",(0,r.jsx)("span",{className:"text-red-600",children:"8"})," to form ",(0,r.jsx)("span",{className:"text-red-600",children:"80"}),", since the first three tokens (125) were already grouped together. ",(0,r.jsx)("span",{className:"text-red-600 font-medium",children:"This 'shift' in the tokenization boundary produces additional complexity"})," in the learning process which has been shown to be detrimental to accuracy.",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),"In the R2L example, each digit of ",(0,r.jsx)("span",{className:"text-teal-600",children:"580"})," aligns neatly with its corresponding sub-operands ",(0,r.jsx)("span",{className:"text-teal-600",children:"789"})," and ",(0,r.jsx)("span",{className:"text-teal-600",children:"791"}),", which is a more intuitive grouping for the model to learn."]})]},e.problem))})})},4549:(e,t,a)=>{"use strict";a.d(t,{default:()=>l});var r=a(95155),s=a(12115),i=a(22130);let l=()=>{let[e,t]=(0,s.useState)(null),[a,l]=(0,s.useState)(0),n=(0,s.useRef)(null),o=[{method:"Pure BPE",accuracy:.24},{method:"Three-digit L2R",accuracy:.26},{method:"Three-digit R2L",accuracy:.29},{method:"Single Digit",accuracy:.35}];(0,s.useEffect)(()=>{let e=()=>{n.current&&l(n.current.offsetWidth)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let d=Math.max(...o.map(e=>e.accuracy)),c=Math.min(400,.6*a);return(0,r.jsxs)(i.Zp,{className:"w-full bg-gradient-to-br from-background to-muted/20 shadow-xl",children:[(0,r.jsxs)(i.aR,{className:"p-4 md:p-6",children:[(0,r.jsx)(i.ZB,{className:"text-lg md:text-xl lg:text-2xl font-bold text-center",children:"How Different Tokenizers Perform in Arithmetic"}),(0,r.jsx)("p",{className:"text-muted-foreground text-center text-xs md:text-sm",children:"Average Accuracy Evaluated on 5-shot Questions"})]}),(0,r.jsx)(i.Wu,{className:"p-4 md:p-6",ref:n,children:(0,r.jsx)("div",{className:"relative",style:{height:c},children:(0,r.jsx)("div",{className:"h-full flex items-end justify-between gap-2 md:gap-4",children:o.map(a=>(0,r.jsxs)("div",{className:"flex flex-col items-center flex-1",children:[(0,r.jsx)("div",{className:"w-full bg-blue-500 hover:bg-blue-600 transition-colors rounded-t-sm relative cursor-pointer flex items-center justify-center ".concat(e===a.method?"bg-blue-600":""),style:{height:"".concat(a.accuracy/d*(c-40),"px")},onMouseEnter:()=>t(a.method),onMouseLeave:()=>t(null),children:(0,r.jsx)("div",{className:"text-white font-bold text-xs md:text-sm",children:a.accuracy.toFixed(2)})}),(0,r.jsx)("div",{className:"mt-2 text-[10px] md:text-xs lg:text-sm font-medium text-gray-600 text-center",children:a.method.split(" ").map((e,t)=>(0,r.jsx)("span",{className:"block leading-tight",children:e},t))})]},a.method))})})})]})}},59370:(e,t,a)=>{"use strict";a.d(t,{default:()=>l});var r=a(95155),s=a(12115),i=a(22130);let l=()=>{let[e,t]=(0,s.useState)("performance"),a=[{digits:"1 digit",gpt2:.72,olmo:.75,llama3:.72,deepseek:.76,llama3_r2l:.75},{digits:"2 digits",gpt2:.37,olmo:.4,llama3:.43,deepseek:.44,llama3_r2l:.46},{digits:"3 digits",gpt2:.06,olmo:.07,llama3:.07,deepseek:.26,llama3_r2l:.11},{digits:"4 digits",gpt2:.03,olmo:.04,llama3:.04,deepseek:.18,llama3_r2l:.06},{digits:"5 digits",gpt2:.02,olmo:.03,llama3:.03,deepseek:.14,llama3_r2l:.05}],l=[{operation:"add",gpt2:.31,olmo:.34,llama3:.37,deepseek:.58,llama3_r2l:.4},{operation:"divide",gpt2:.32,olmo:.35,llama3:.31,deepseek:.41,llama3_r2l:.35},{operation:"multiply",gpt2:.16,olmo:.16,llama3:.17,deepseek:.18,llama3_r2l:.17},{operation:"subtract",gpt2:.18,olmo:.19,llama3:.19,deepseek:.26,llama3_r2l:.23}],n=[{type:"float",gpt2:.14,olmo:.15,llama3:.17,deepseek:.24,llama3_r2l:.18},{type:"integer",gpt2:.35,olmo:.37,llama3:.41,deepseek:.47,llama3_r2l:.43}],o=["gpt2","olmo","llama3","llama3_r2l","deepseek"],d=e=>e>=.7?"bg-teal-200":e>=.4?"bg-teal-100":e>=.2?"bg-red-100":"bg-red-200",c=e=>o.reduce((t,a)=>e[a]>e[t]?a:t,o[0]);return(0,r.jsxs)(i.Zp,{className:"w-full max-w-4xl p-4 md:p-8 bg-gradient-to-br from-background to-muted/20",children:[(0,r.jsxs)(i.aR,{className:"space-y-2",children:[(0,r.jsx)(i.ZB,{className:"text-xl md:text-2xl font-semibold text-center",children:"Comparing Pretrained Model Performance"}),(0,r.jsx)("p",{className:"text-muted-foreground text-center text-xs md:text-sm",children:"Average accuracy; Evaluted with 5-shot arithmetic questions"}),(0,r.jsx)("div",{className:"text-center",children:(0,r.jsx)("div",{children:(0,r.jsxs)("select",{onChange:e=>{t(e.target.value)},className:"mt-4 p-2 border rounded text-sm md:text-base",children:[(0,r.jsx)("option",{value:"digits",children:"Number of Digits"}),(0,r.jsx)("option",{value:"operation",children:"Operation"}),(0,r.jsx)("option",{value:"type",children:"Number Type"})]})})})]}),(0,r.jsx)(i.Wu,{children:(0,r.jsx)("div",{className:"relative overflow-x-auto rounded-lg shadow-lg border border-gray-200",children:(0,r.jsx)("div",{className:"w-full overflow-x-scroll",children:(0,r.jsxs)("table",{className:"w-full border-collapse border min-w-[600px]",children:[(0,r.jsx)("thead",{className:"border-b",children:(0,r.jsxs)("tr",{className:"border-b",children:[(0,r.jsxs)("th",{className:"px-2 md:px-4 py-2 text-[10px] sm:text-xs md:text-sm text-gray-600 border-b border-r",children:[(()=>{switch(e){case"digits":default:return"Number of Digits";case"operation":return"Operation";case"type":return"Number Type"}})()," ",(0,r.jsx)("span",{className:"font-bold text-gray-800 mx-1",children:"\\"})," Tokenizer"]}),o.map((e,t)=>(0,r.jsxs)("th",{className:"px-2 md:px-4 py-2 text-[10px] sm:text-xs md:text-sm text-gray-600 border-b ".concat(t<o.length-1?"border-r":""),children:[e.toUpperCase(),(0,r.jsx)("div",{className:"text-[8px] sm:text-[10px] md:text-xs text-gray-400",children:"gpt2"===e||"olmo"===e?"BPE":"llama3"===e?"Three-digit L2R":"llama3_r2l"===e?"Three-digit R2L":"deepseek"===e?"Single-digit":""})]},e))]})}),(0,r.jsx)("tbody",{children:(()=>{switch(e){case"digits":default:return a;case"operation":return l;case"type":return n}})().map(e=>{let t=c(e),a="digits"in e?e.digits:"operation"in e?e.operation:e.type;return(0,r.jsxs)("tr",{className:"hover:bg-teal-50 transition-colors border-b",children:[(0,r.jsx)("td",{className:"px-2 md:px-6 py-2 md:py-4 font-medium border-r text-gray-800 text-center text-[10px] sm:text-xs md:text-sm",children:a}),o.map((a,s)=>(0,r.jsx)("td",{className:"px-2 md:px-6 py-2 md:py-4 text-center font-mono text-[10px] sm:text-xs md:text-sm ".concat(d(e[a])," transition-colors ").concat(s<o.length-1?"border-r":""),children:a===t?(0,r.jsx)("b",{children:e[a].toFixed(2)}):e[a].toFixed(2)},a))]},a)})})]})})})})]})}}},e=>{var t=t=>e(e.s=t);e.O(0,[409,441,517,358],()=>t(31654)),_N_E=e.O()}]); |