Repository Public MIT Research preview
1% S02-F01 — Du texte aux jetons, puis la génération jeton par jeton (figure phare 2).2% Idée : le modèle ne reçoit ni lettres ni mots, mais une suite d'identifiants de jetons ; il produit3% ensuite UN jeton par étape. Un mot peut donc demander plusieurs étapes (ici « tapis » = t + ap + is).4% DONNÉES : S02-F01-donnees.tex, généré par demos/src/atlas_s02/exporter_donnees_figure.py.5\input{S02-F01-donnees.tex}6\begin{tikzpicture}[x=1mm, y=1mm]7 % ---------- Haut : texte -> jetons -> identifiants ----------8 \node[atlas step] (n1) at (2.5,47.5) {1};9 \node[atlas label, anchor=west] at (6,47.5) {\textbf{Texte}};10 \node[atlas step] (n2) at (2.5,38.2) {2};11 \node[atlas label, anchor=west] at (6,38.2) {\textbf{Jetons}};12 \node[atlas step] (n3) at (2.5,30.4) {3};13 \node[atlas label, anchor=west] at (6,30.4) {\textbf{Identifiants}};14 \node[atlas block, anchor=west, font=\ttfamily\AtlasSizeLabel, inner ysep=3.2pt] (txt) at (29,47.5) {« \AtlasFigAmorce\ »};15 \coordinate (j-0) at (29,38.2);16 \foreach \jeton/\ident [count=\i, remember=\i as \prec (initially 0)] in \AtlasFigJetonsIdentifiants {17 \ifnum\prec=018 \node[atlas token, anchor=west] (j-\i) at (j-0) {\jeton};19 \else20 \node[atlas token, anchor=west] (j-\i) at ([xshift=2.2pt]j-\prec.east) {\jeton};21 \fi22 \node[atlas label, font=\AtlasTabularFont\AtlasSizeLabel, text=atlasMuted] (i-\i) at (j-\i |- 0,30.4) {\ident};23 }24 \draw[atlas arrow] (txt.south) -- (txt.south |- j-1.north);25 \draw[draw=atlasUncertain, line width=.9pt, rounded corners=1.5pt]26 ([xshift=-1.2mm, yshift=-1.6mm]i-6.south west) rectangle ([xshift=1.2mm, yshift=1.4mm]i-7.north east);27 \node[atlas note, anchor=north west, text width=44mm] at (95,51.6)28 {Le modèle ne reçoit ni lettres ni mots : seulement cette suite de nombres.};29 \node[atlas note, anchor=north west, text width=44mm] at (95,40.6)30 {« chaton », absent des douze phrases, devient chat + o + n.};31 \node[atlas note, anchor=north west, text width=44mm] at (95,32.4)32 {Vocabulaire de ce jouet : \AtlasFigTailleVocabulaire\ jetons.};33 % ---------- Bas : trois étapes de génération ----------34 \foreach \x/\num/\ctx/\cand/\choisi in {0/4/\AtlasFigContexteA/\AtlasFigCandidatsA/\AtlasFigChoisiA,35 41/5/\AtlasFigContexteB/\AtlasFigCandidatsB/\AtlasFigChoisiB,36 82/6/\AtlasFigContexteC/\AtlasFigCandidatsC/\AtlasFigChoisiC} {37 \begin{scope}[xshift=\x mm]38 \draw[atlas region, fill=atlasPanel, fill opacity=.4] (0,0) rectangle (37,21.5);39 \node[atlas step] at (2.6,21.5) {\num};40 \node[atlas note, anchor=west] at (3.5,17.3) {contexte lu : … \texttt{\ctx}};41 \node[atlas block, minimum width=13mm, minimum height=6.4mm, inner ysep=2pt] (m) at (9.5,9.6) {Modèle};42 \node[atlas token valid, font=\ttfamily\AtlasSizeLabel\bfseries] (c) at (30,9.6) {\choisi};43 \draw[atlas arrow valid] (m.east) -- (c.west);44 \node[atlas note, anchor=west] at (3.5,2.9) {probabilités : \cand};45 \end{scope}46 }47 \draw[atlas arrow] (37,9.6) -- (41,9.6);48 \draw[atlas arrow] (78,9.6) -- (82,9.6);49 \draw[atlas arrow] ([yshift=-1.6mm]i-7.south) -- ++(0,-2.2) -| (24,21.5);50 % ---------- Résultat ----------51 \draw[atlas arrow valid] (119,9.6) -- (123.5,9.6);52 \node[atlas block valid, minimum width=17mm, font=\ttfamily\AtlasSizeLabel\bfseries] (res) at (133,9.6) {\AtlasFigMotProduit};53 \node[atlas note, anchor=south, align=center] at (133,14.2) {un mot,\\ trois étapes};54 \node[atlas note, anchor=north, align=center] at (133,5) {jetons mis\\ bout à bout};55\end{tikzpicture}56