import{s as j,n as q,o as S}from"../chunks/scheduler.36a0863c.js";import{S as U,i as k,g as s,s as r,r as D,A as O,h as n,f as t,c as i,j as $,u as z,x as v,k as G,y as I,a as o,v as K,d as N,t as W,w as F}from"../chunks/index.f891bdb2.js";import{H as J}from"../chunks/Heading.3fb90772.js";function Q(M){let l,x,f,T,p,b,d,C=`Hay un creciente campo de estudio empeñado en la investigación del funcionamiento interno de los transformers de gran escala como BERT
(que algunos llaman “BERTología”). Algunos buenos ejemplos de este campo son:`,P,c,H=`<li>BERT Rediscovers the Classical NLP Pipeline por Ian Tenney, Dipanjan Das, Ellie Pavlick:
<a href="https://arxiv.org/abs/1905.05950" rel="nofollow">https://arxiv.org/abs/1905.05950</a></li> <li>Are Sixteen Heads Really Better than One? por Paul Michel, Omer Levy, Graham Neubig: <a href="https://arxiv.org/abs/1905.10650" rel="nofollow">https://arxiv.org/abs/1905.10650</a></li> <li>What Does BERT Look At? An Analysis of BERT’s Attention por Kevin Clark, Urvashi Khandelwal, Omer Levy, Christopher D.
Manning: <a href="https://arxiv.org/abs/1906.04341" rel="nofollow">https://arxiv.org/abs/1906.04341</a></li> <li>CAT-probing: A Metric-based Approach to Interpret How Pre-trained Models for Programming Language Attend Code Structure: <a href="https://arxiv.org/abs/2210.04633" rel="nofollow">https://arxiv.org/abs/2210.04633</a></li>`,_,m,R=`Para asistir al desarrollo de este nuevo campo, hemos incluido algunas features adicionales en los modelos BERT/GPT/GPT-2 para
ayudar a acceder a las representaciones internas, principalmente adaptado de la gran obra de Paul Michel
(<a href="https://arxiv.org/abs/1905.10650" rel="nofollow">https://arxiv.org/abs/1905.10650</a>):`,y,u,A=`<li>accediendo a todos los hidden-states de BERT/GPT/GPT-2,</li> <li>accediendo a todos los pesos de atención para cada head de BERT/GPT/GPT-2,</li> <li>adquiriendo los valores de salida y gradientes de las heads para poder computar la métrica de importancia de las heads y realizar la poda de heads como se explica
en <a href="https://arxiv.org/abs/1905.10650" rel="nofollow">https://arxiv.org/abs/1905.10650</a>.</li>`,w,h,B=`Para ayudarte a entender y usar estas features, hemos añadido un script específico de ejemplo: <a href="https://github.com/huggingface/transformers/tree/main/examples/research_projects/bertology/run_bertology.py" rel="nofollow">bertology.py</a> mientras extraes información y cortas un modelo pre-entrenado en
GLUE.`,L,g,E;return p=new J({props:{title:"BERTología",local:"bertología",headingTag:"h1"}}),{c(){l=s("meta"),x=r(),f=s("p"),T=r(),D(p.$$.fragment),b=r(),d=s("p"),d.textContent=C,P=r(),c=s("ul"),c.innerHTML=H,_=r(),m=s("p"),m.innerHTML=R,y=r(),u=s("ul"),u.innerHTML=A,w=r(),h=s("p"),h.innerHTML=B,L=r(),g=s("p"),this.h()},l(e){const a=O("svelte-u9bgzb",document.head);l=n(a,"META",{name:!0,content:!0}),a.forEach(t),x=i(e),f=n(e,"P",{}),$(f).forEach(t),T=i(e),z(p.$$.fragment,e),b=i(e),d=n(e,"P",{"data-svelte-h":!0}),v(d)!=="svelte-t8qs96"&&(d.textContent=C),P=i(e),c=n(e,"UL",{"data-svelte-h":!0}),v(c)!=="svelte-1sb7ig0"&&(c.innerHTML=H),_=i(e),m=n(e,"P",{"data-svelte-h":!0}),v(m)!=="svelte-f71qwa"&&(m.innerHTML=R),y=i(e),u=n(e,"UL",{"data-svelte-h":!0}),v(u)!=="svelte-wp6xpp"&&(u.innerHTML=A),w=i(e),h=n(e,"P",{"data-svelte-h":!0}),v(h)!=="svelte-1wml3jh"&&(h.innerHTML=B),L=i(e),g=n(e,"P",{}),$(g).forEach(t),this.h()},h(){G(l,"name","hf:doc:metadata"),G(l,"content",V)},m(e,a){I(document.head,l),o(e,x,a),o(e,f,a),o(e,T,a),K(p,e,a),o(e,b,a),o(e,d,a),o(e,P,a),o(e,c,a),o(e,_,a),o(e,m,a),o(e,y,a),o(e,u,a),o(e,w,a),o(e,h,a),o(e,L,a),o(e,g,a),E=!0},p:q,i(e){E||(N(p.$$.fragment,e),E=!0)},o(e){W(p.$$.fragment,e),E=!1},d(e){e&&(t(x),t(f),t(T),t(b),t(d),t(P),t(c),t(_),t(m),t(y),t(u),t(w),t(h),t(L),t(g)),t(l),F(p,e)}}}const V='{"title":"BERTología","local":"bertología","sections":[],"depth":1}';function X(M){return S(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ae extends U{constructor(l){super(),k(this,l,X,Q,j,{})}}export{ae as component};
