import{S as la,i as oa,s as na,e as l,k as h,w as We,t as i,M as ia,c as o,d as a,m,a as n,x as Ye,h as r,b as u,G as t,g as c,y as Ze,L as ra,q as Je,o as ea,B as aa,v as sa}from"../../chunks/vendor-hf-doc-builder.js";import{I as ta}from"../../chunks/IconCopyLink-hf-doc-builder.js";function ua($e){let d,G,p,g,P,M,ie,I,re,H,v,y,C,k,se,D,ue,Q,b,ce,_,he,me,j,$,fe,F,R,O,de,K,z,pe,U,w,E,ve,X,q,ge,ye,be,A,we,S,Le,Me,W,L,ke,x,B,_e,Ee,Y,f,Xe,T,Ae,xe,V,Te,Ve,Z;return M=new ta({}),k=new ta({}),{c(){d=l("meta"),G=h(),p=l("h1"),g=l("a"),P=l("span"),We(M.$$.fragment),ie=h(),I=l("span"),re=i("XLM-V"),H=h(),v=l("h2"),y=l("a"),C=l("span"),We(k.$$.fragment),se=h(),D=l("span"),ue=i("Overview"),Q=h(),b=l("p"),ce=i(`XLM-V is multilingual language model with a one million token vocabulary trained on 2.5TB of data from Common Crawl (same as XLM-R).
It was introduced in the `),_=l("a"),he=i("XLM-V: Overcoming the Vocabulary Bottleneck in Multilingual Masked Language Models"),me=i(`
paper by Davis Liang, Hila Gonen, Yuning Mao, Rui Hou, Naman Goyal, Marjan Ghazvininejad, Luke Zettlemoyer and Madian Khabsa.`),j=h(),$=l("p"),fe=i("From the abstract of the XLM-V paper:"),F=h(),R=l("p"),O=l("em"),de=i(`Large multilingual language models typically rely on a single vocabulary shared across 100+ languages.
As these models have increased in parameter count and depth, vocabulary size has remained largely unchanged.
This vocabulary bottleneck limits the representational capabilities of multilingual models like XLM-R.
In this paper, we introduce a new approach for scaling to very large multilingual vocabularies by
de-emphasizing token sharing between languages with little lexical overlap and assigning vocabulary capacity
to achieve sufficient coverage for each individual language. Tokenizations using our vocabulary are typically
more semantically meaningful and shorter compared to XLM-R. Leveraging this improved vocabulary, we train XLM-V,
a multilingual language model with a one million token vocabulary. XLM-V outperforms XLM-R on every task we
tested on ranging from natural language inference (XNLI), question answering (MLQA, XQuAD, TyDiQA), and
named entity recognition (WikiAnn) to low-resource tasks (Americas NLI, MasakhaNER).`),K=h(),z=l("p"),pe=i("Tips:"),U=h(),w=l("ul"),E=l("li"),ve=i("XLM-V is compatible with the XLM-RoBERTa model architecture, only model weights from "),X=l("a"),q=l("code"),ge=i("fairseq"),ye=i(`
library had to be converted.`),be=h(),A=l("li"),we=i("The "),S=l("code"),Le=i("XLMTokenizer"),Me=i(" implementation is used to load the vocab and performs tokenization."),W=h(),L=l("p"),ke=i("A XLM-V (base size) model is available under the "),x=l("a"),B=l("code"),_e=i("facebook/xlm-v-base"),Ee=i(" identifier."),Y=h(),f=l("p"),Xe=i("This model was contributed by "),T=l("a"),Ae=i("stefan-it"),xe=i(`, including detailed experiments with XLM-V on downstream tasks.
The experiments repository can be found `),V=l("a"),Te=i("here"),Ve=i("."),this.h()},l(e){const s=ia('[data-svelte="svelte-1phssyn"]',document.head);d=o(s,"META",{name:!0,content:!0}),s.forEach(a),G=m(e),p=o(e,"H1",{class:!0});var J=n(p);g=o(J,"A",{id:!0,class:!0,href:!0});var Re=n(g);P=o(Re,"SPAN",{});var ze=n(P);Ye(M.$$.fragment,ze),ze.forEach(a),Re.forEach(a),ie=m(J),I=o(J,"SPAN",{});var Ne=n(I);re=r(Ne,"XLM-V"),Ne.forEach(a),J.forEach(a),H=m(e),v=o(e,"H2",{class:!0});var ee=n(v);y=o(ee,"A",{id:!0,class:!0,href:!0});var Pe=n(y);C=o(Pe,"SPAN",{});var Ie=n(C);Ye(k.$$.fragment,Ie),Ie.forEach(a),Pe.forEach(a),se=m(ee),D=o(ee,"SPAN",{});var Ce=n(D);ue=r(Ce,"Overview"),Ce.forEach(a),ee.forEach(a),Q=m(e),b=o(e,"P",{});var ae=n(b);ce=r(ae,`XLM-V is multilingual language model with a one million token vocabulary trained on 2.5TB of data from Common Crawl (same as XLM-R).
It was introduced in the `),_=o(ae,"A",{href:!0,rel:!0});var De=n(_);he=r(De,"XLM-V: Overcoming the Vocabulary Bottleneck in Multilingual Masked Language Models"),De.forEach(a),me=r(ae,`
paper by Davis Liang, Hila Gonen, Yuning Mao, Rui Hou, Naman Goyal, Marjan Ghazvininejad, Luke Zettlemoyer and Madian Khabsa.`),ae.forEach(a),j=m(e),$=o(e,"P",{});var Oe=n($);fe=r(Oe,"From the abstract of the XLM-V paper:"),Oe.forEach(a),F=m(e),R=o(e,"P",{});var qe=n(R);O=o(qe,"EM",{});var Se=n(O);de=r(Se,`Large multilingual language models typically rely on a single vocabulary shared across 100+ languages.
As these models have increased in parameter count and depth, vocabulary size has remained largely unchanged.
This vocabulary bottleneck limits the representational capabilities of multilingual models like XLM-R.
In this paper, we introduce a new approach for scaling to very large multilingual vocabularies by
de-emphasizing token sharing between languages with little lexical overlap and assigning vocabulary capacity
to achieve sufficient coverage for each individual language. Tokenizations using our vocabulary are typically
more semantically meaningful and shorter compared to XLM-R. Leveraging this improved vocabulary, we train XLM-V,
a multilingual language model with a one million token vocabulary. XLM-V outperforms XLM-R on every task we
tested on ranging from natural language inference (XNLI), question answering (MLQA, XQuAD, TyDiQA), and
named entity recognition (WikiAnn) to low-resource tasks (Americas NLI, MasakhaNER).`),Se.forEach(a),qe.forEach(a),K=m(e),z=o(e,"P",{});var Be=n(z);pe=r(Be,"Tips:"),Be.forEach(a),U=m(e),w=o(e,"UL",{});var te=n(w);E=o(te,"LI",{});var le=n(E);ve=r(le,"XLM-V is compatible with the XLM-RoBERTa model architecture, only model weights from "),X=o(le,"A",{href:!0,rel:!0});var Ge=n(X);q=o(Ge,"CODE",{});var He=n(q);ge=r(He,"fairseq"),He.forEach(a),Ge.forEach(a),ye=r(le,`
library had to be converted.`),le.forEach(a),be=m(te),A=o(te,"LI",{});var oe=n(A);we=r(oe,"The "),S=o(oe,"CODE",{});var Qe=n(S);Le=r(Qe,"XLMTokenizer"),Qe.forEach(a),Me=r(oe," implementation is used to load the vocab and performs tokenization."),oe.forEach(a),te.forEach(a),W=m(e),L=o(e,"P",{});var ne=n(L);ke=r(ne,"A XLM-V (base size) model is available under the "),x=o(ne,"A",{href:!0,rel:!0});var je=n(x);B=o(je,"CODE",{});var Fe=n(B);_e=r(Fe,"facebook/xlm-v-base"),Fe.forEach(a),je.forEach(a),Ee=r(ne," identifier."),ne.forEach(a),Y=m(e),f=o(e,"P",{});var N=n(f);Xe=r(N,"This model was contributed by "),T=o(N,"A",{href:!0,rel:!0});var Ke=n(T);Ae=r(Ke,"stefan-it"),Ke.forEach(a),xe=r(N,`, including detailed experiments with XLM-V on downstream tasks.
The experiments repository can be found `),V=o(N,"A",{href:!0,rel:!0});var Ue=n(V);Te=r(Ue,"here"),Ue.forEach(a),Ve=r(N,"."),N.forEach(a),this.h()},h(){u(d,"name","hf:doc:metadata"),u(d,"content",JSON.stringify(ca)),u(g,"id","xlmv"),u(g,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(g,"href","#xlmv"),u(p,"class","relative group"),u(y,"id","overview"),u(y,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(y,"href","#overview"),u(v,"class","relative group"),u(_,"href","https://arxiv.org/abs/2301.10472"),u(_,"rel","nofollow"),u(X,"href","https://github.com/facebookresearch/fairseq"),u(X,"rel","nofollow"),u(x,"href","https://huggingface.co/facebook/xlm-v-base"),u(x,"rel","nofollow"),u(T,"href","https://huggingface.co/stefan-it"),u(T,"rel","nofollow"),u(V,"href","https://github.com/stefan-it/xlm-v-experiments"),u(V,"rel","nofollow")},m(e,s){t(document.head,d),c(e,G,s),c(e,p,s),t(p,g),t(g,P),Ze(M,P,null),t(p,ie),t(p,I),t(I,re),c(e,H,s),c(e,v,s),t(v,y),t(y,C),Ze(k,C,null),t(v,se),t(v,D),t(D,ue),c(e,Q,s),c(e,b,s),t(b,ce),t(b,_),t(_,he),t(b,me),c(e,j,s),c(e,$,s),t($,fe),c(e,F,s),c(e,R,s),t(R,O),t(O,de),c(e,K,s),c(e,z,s),t(z,pe),c(e,U,s),c(e,w,s),t(w,E),t(E,ve),t(E,X),t(X,q),t(q,ge),t(E,ye),t(w,be),t(w,A),t(A,we),t(A,S),t(S,Le),t(A,Me),c(e,W,s),c(e,L,s),t(L,ke),t(L,x),t(x,B),t(B,_e),t(L,Ee),c(e,Y,s),c(e,f,s),t(f,Xe),t(f,T),t(T,Ae),t(f,xe),t(f,V),t(V,Te),t(f,Ve),Z=!0},p:ra,i(e){Z||(Je(M.$$.fragment,e),Je(k.$$.fragment,e),Z=!0)},o(e){ea(M.$$.fragment,e),ea(k.$$.fragment,e),Z=!1},d(e){a(d),e&&a(G),e&&a(p),aa(M),e&&a(H),e&&a(v),aa(k),e&&a(Q),e&&a(b),e&&a(j),e&&a($),e&&a(F),e&&a(R),e&&a(K),e&&a(z),e&&a(U),e&&a(w),e&&a(W),e&&a(L),e&&a(Y),e&&a(f)}}}const ca={local:"xlmv",sections:[{local:"overview",title:"Overview"}],title:"XLM-V"};function ha($e){return sa(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class da extends la{constructor(d){super();oa(this,d,ha,ua,na,{})}}export{da as default,ca as metadata};
