import{S as Ze,i as et,s as tt,e as r,k as c,w as je,t as i,M as at,c as o,d as a,m as u,a as n,x as Fe,h as s,b as l,G as t,g as f,y as Ke,L as rt,q as Qe,o as Ve,B as Xe,v as ot}from"../../chunks/vendor-hf-doc-builder.js";import{I as Ye}from"../../chunks/IconCopyLink-hf-doc-builder.js";function nt(xe){let d,M,v,w,q,T,re,N,oe,W,b,g,G,B,ne,C,ie,J,E,se,R,le,he,H,O,fe,j,$,D,ce,F,I,ue,K,p,_,pe,L,me,de,ve,y,be,z,we,ge,Ee,P,Te,k,Be,Re,Q,m,_e,A,ye,Pe,x,ke,Ae,V;return T=new Ye({}),B=new Ye({}),{c(){d=r("meta"),M=c(),v=r("h1"),w=r("a"),q=r("span"),je(T.$$.fragment),re=c(),N=r("span"),oe=i("BORT"),W=c(),b=r("h2"),g=r("a"),G=r("span"),je(B.$$.fragment),ne=c(),C=r("span"),ie=i("Overview"),J=c(),E=r("p"),se=i("The BORT model was proposed in "),R=r("a"),le=i("Optimal Subarchitecture Extraction for BERT"),he=i(` by
Adrian de Wynter and Daniel J. Perry. It is an optimal subset of architectural parameters for the BERT, which the
authors refer to as \u201CBort\u201D.`),H=c(),O=r("p"),fe=i("The abstract from the paper is the following:"),j=c(),$=r("p"),D=r("em"),ce=i(`We extract an optimal subset of architectural parameters for the BERT architecture from Devlin et al. (2018) by
applying recent breakthroughs in algorithms for neural architecture search. This optimal subset, which we refer to as
\u201CBort\u201D, is demonstrably smaller, having an effective (that is, not counting the embedding layer) size of 5.5% the
original BERT-large architecture, and 16% of the net size. Bort is also able to be pretrained in 288 GPU hours, which
is 1.2% of the time required to pretrain the highest-performing BERT parametric architectural variant, RoBERTa-large
(Liu et al., 2019), and about 33% of that of the world-record, in GPU hours, required to train BERT-large on the same
hardware. It is also 7.9x faster on a CPU, as well as being better performing than other compressed variants of the
architecture, and some of the non-compressed variants: it obtains performance improvements of between 0.3% and 31%,
absolute, with respect to BERT-large, on multiple public natural language understanding (NLU) benchmarks.`),F=c(),I=r("p"),ue=i("Tips:"),K=c(),p=r("ul"),_=r("li"),pe=i("BORT\u2019s model architecture is based on BERT, so one can refer to "),L=r("a"),me=i("BERT\u2019s documentation page"),de=i(` for the
model\u2019s API as well as usage examples.`),ve=c(),y=r("li"),be=i("BORT uses the RoBERTa tokenizer instead of the BERT tokenizer, so one can refer to "),z=r("a"),we=i("RoBERTa\u2019s documentation page"),ge=i(" for the tokenizer\u2019s API as well as usage examples."),Ee=c(),P=r("li"),Te=i("BORT requires a specific fine-tuning algorithm, called "),k=r("a"),Be=i("Agora"),Re=i(` ,
that is sadly not open-sourced yet. It would be very useful for the community, if someone tries to implement the
algorithm to make BORT fine-tuning work.`),Q=c(),m=r("p"),_e=i("This model was contributed by "),A=r("a"),ye=i("stefan-it"),Pe=i(". The original code can be found "),x=r("a"),ke=i("here"),Ae=i("."),this.h()},l(e){const h=at('[data-svelte="svelte-1phssyn"]',document.head);d=o(h,"META",{name:!0,content:!0}),h.forEach(a),M=u(e),v=o(e,"H1",{class:!0});var X=n(v);w=o(X,"A",{id:!0,class:!0,href:!0});var Oe=n(w);q=o(Oe,"SPAN",{});var $e=n(q);Fe(T.$$.fragment,$e),$e.forEach(a),Oe.forEach(a),re=u(X),N=o(X,"SPAN",{});var Ie=n(N);oe=s(Ie,"BORT"),Ie.forEach(a),X.forEach(a),W=u(e),b=o(e,"H2",{class:!0});var Y=n(b);g=o(Y,"A",{id:!0,class:!0,href:!0});var Le=n(g);G=o(Le,"SPAN",{});var ze=n(G);Fe(B.$$.fragment,ze),ze.forEach(a),Le.forEach(a),ne=u(Y),C=o(Y,"SPAN",{});var Se=n(C);ie=s(Se,"Overview"),Se.forEach(a),Y.forEach(a),J=u(e),E=o(e,"P",{});var Z=n(E);se=s(Z,"The BORT model was proposed in "),R=o(Z,"A",{href:!0,rel:!0});var Ue=n(R);le=s(Ue,"Optimal Subarchitecture Extraction for BERT"),Ue.forEach(a),he=s(Z,` by
Adrian de Wynter and Daniel J. Perry. It is an optimal subset of architectural parameters for the BERT, which the
authors refer to as \u201CBort\u201D.`),Z.forEach(a),H=u(e),O=o(e,"P",{});var qe=n(O);fe=s(qe,"The abstract from the paper is the following:"),qe.forEach(a),j=u(e),$=o(e,"P",{});var Ne=n($);D=o(Ne,"EM",{});var Ge=n(D);ce=s(Ge,`We extract an optimal subset of architectural parameters for the BERT architecture from Devlin et al. (2018) by
applying recent breakthroughs in algorithms for neural architecture search. This optimal subset, which we refer to as
\u201CBort\u201D, is demonstrably smaller, having an effective (that is, not counting the embedding layer) size of 5.5% the
original BERT-large architecture, and 16% of the net size. Bort is also able to be pretrained in 288 GPU hours, which
is 1.2% of the time required to pretrain the highest-performing BERT parametric architectural variant, RoBERTa-large
(Liu et al., 2019), and about 33% of that of the world-record, in GPU hours, required to train BERT-large on the same
hardware. It is also 7.9x faster on a CPU, as well as being better performing than other compressed variants of the
architecture, and some of the non-compressed variants: it obtains performance improvements of between 0.3% and 31%,
absolute, with respect to BERT-large, on multiple public natural language understanding (NLU) benchmarks.`),Ge.forEach(a),Ne.forEach(a),F=u(e),I=o(e,"P",{});var Ce=n(I);ue=s(Ce,"Tips:"),Ce.forEach(a),K=u(e),p=o(e,"UL",{});var S=n(p);_=o(S,"LI",{});var ee=n(_);pe=s(ee,"BORT\u2019s model architecture is based on BERT, so one can refer to "),L=o(ee,"A",{href:!0});var De=n(L);me=s(De,"BERT\u2019s documentation page"),De.forEach(a),de=s(ee,` for the
model\u2019s API as well as usage examples.`),ee.forEach(a),ve=u(S),y=o(S,"LI",{});var te=n(y);be=s(te,"BORT uses the RoBERTa tokenizer instead of the BERT tokenizer, so one can refer to "),z=o(te,"A",{href:!0});var Me=n(z);we=s(Me,"RoBERTa\u2019s documentation page"),Me.forEach(a),ge=s(te," for the tokenizer\u2019s API as well as usage examples."),te.forEach(a),Ee=u(S),P=o(S,"LI",{});var ae=n(P);Te=s(ae,"BORT requires a specific fine-tuning algorithm, called "),k=o(ae,"A",{href:!0,rel:!0});var We=n(k);Be=s(We,"Agora"),We.forEach(a),Re=s(ae,` ,
that is sadly not open-sourced yet. It would be very useful for the community, if someone tries to implement the
algorithm to make BORT fine-tuning work.`),ae.forEach(a),S.forEach(a),Q=u(e),m=o(e,"P",{});var U=n(m);_e=s(U,"This model was contributed by "),A=o(U,"A",{href:!0,rel:!0});var Je=n(A);ye=s(Je,"stefan-it"),Je.forEach(a),Pe=s(U,". The original code can be found "),x=o(U,"A",{href:!0,rel:!0});var He=n(x);ke=s(He,"here"),He.forEach(a),Ae=s(U,"."),U.forEach(a),this.h()},h(){l(d,"name","hf:doc:metadata"),l(d,"content",JSON.stringify(it)),l(w,"id","bort"),l(w,"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"),l(w,"href","#bort"),l(v,"class","relative group"),l(g,"id","overview"),l(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"),l(g,"href","#overview"),l(b,"class","relative group"),l(R,"href","https://arxiv.org/abs/2010.10499"),l(R,"rel","nofollow"),l(L,"href","bert"),l(z,"href","roberta"),l(k,"href","https://adewynter.github.io/notes/bort_algorithms_and_applications.html#fine-tuning-with-algebraic-topology"),l(k,"rel","nofollow"),l(A,"href","https://huggingface.co/stefan-it"),l(A,"rel","nofollow"),l(x,"href","https://github.com/alexa/bort/"),l(x,"rel","nofollow")},m(e,h){t(document.head,d),f(e,M,h),f(e,v,h),t(v,w),t(w,q),Ke(T,q,null),t(v,re),t(v,N),t(N,oe),f(e,W,h),f(e,b,h),t(b,g),t(g,G),Ke(B,G,null),t(b,ne),t(b,C),t(C,ie),f(e,J,h),f(e,E,h),t(E,se),t(E,R),t(R,le),t(E,he),f(e,H,h),f(e,O,h),t(O,fe),f(e,j,h),f(e,$,h),t($,D),t(D,ce),f(e,F,h),f(e,I,h),t(I,ue),f(e,K,h),f(e,p,h),t(p,_),t(_,pe),t(_,L),t(L,me),t(_,de),t(p,ve),t(p,y),t(y,be),t(y,z),t(z,we),t(y,ge),t(p,Ee),t(p,P),t(P,Te),t(P,k),t(k,Be),t(P,Re),f(e,Q,h),f(e,m,h),t(m,_e),t(m,A),t(A,ye),t(m,Pe),t(m,x),t(x,ke),t(m,Ae),V=!0},p:rt,i(e){V||(Qe(T.$$.fragment,e),Qe(B.$$.fragment,e),V=!0)},o(e){Ve(T.$$.fragment,e),Ve(B.$$.fragment,e),V=!1},d(e){a(d),e&&a(M),e&&a(v),Xe(T),e&&a(W),e&&a(b),Xe(B),e&&a(J),e&&a(E),e&&a(H),e&&a(O),e&&a(j),e&&a($),e&&a(F),e&&a(I),e&&a(K),e&&a(p),e&&a(Q),e&&a(m)}}}const it={local:"bort",sections:[{local:"overview",title:"Overview"}],title:"BORT"};function st(xe){return ot(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ft extends Ze{constructor(d){super();et(this,d,st,nt,tt,{})}}export{ft as default,it as metadata};
