1 %% -*- mode: latex; mode: reftex; mode: flyspell; coding: utf-8; tex-command: "pdflatex.sh" -*-
3 %% Any copyright is dedicated to the Public Domain.
4 %% https://creativecommons.org/publicdomain/zero/1.0/
5 %% Written by Francois Fleuret <francois@fleuret.org>
7 \documentclass[11pt,a4paper,oneside]{article}
8 \usepackage[paperheight=15cm,paperwidth=8cm,top=2mm,bottom=15mm,right=2mm,left=2mm]{geometry}
9 %\usepackage[a4paper,top=2.5cm,bottom=2cm,left=2.5cm,right=2.5cm]{geometry}
10 \usepackage[utf8]{inputenc}
11 \usepackage{amsmath,amssymb,dsfont}
12 \usepackage[pdftex]{graphicx}
13 \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue,citecolor=blue]{hyperref}
16 \usetikzlibrary{arrows,arrows.meta,calc}
17 \usetikzlibrary{patterns,backgrounds}
18 \usetikzlibrary{positioning,fit}
19 \usetikzlibrary{shapes.geometric,shapes.multipart}
20 \usetikzlibrary{patterns.meta,decorations.pathreplacing,calligraphy}
21 \usetikzlibrary{tikzmark}
22 \usetikzlibrary{decorations.pathmorphing}
23 \usepackage[round]{natbib}
24 \usepackage[osf]{libertine}
25 \usepackage{microtype}
27 \usepackage{mleftright}
30 \setlist[itemize]{leftmargin=0pt,itemindent=1em,itemsep=2ex}
31 \setlist{nosep} % or \setlist{noitemsep} to leave space around whole list
33 \newcommand{\setmuskip}[2]{#1=#2\relax}
34 \setmuskip{\thinmuskip}{1.5mu} % by default it is equal to 3 mu
35 \setmuskip{\medmuskip}{2mu} % by default it is equal to 4 mu
36 \setmuskip{\thickmuskip}{3.5mu} % by default it is equal to 5 mu
38 \setlength{\parindent}{0cm}
39 \setlength{\parskip}{1ex}
40 %\renewcommand{\baselinestretch}{1.3}
41 %\setlength{\tabcolsep}{0pt}
42 %\renewcommand{\arraystretch}{1.0}
44 \def\argmax{\operatornamewithlimits{argmax}}
45 \def\argmin{\operatornamewithlimits{argmin}}
47 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49 \def\given{\,\middle\vert\,}
50 \def\proba{\operatorname{P}}
51 \newcommand{\seq}{{S}}
52 \newcommand{\expect}{\mathds{E}}
53 \newcommand{\variance}{\mathds{V}}
54 \newcommand{\empexpect}{\hat{\mathds{E}}}
55 \newcommand{\mutinf}{\mathds{I}}
56 \newcommand{\empmutinf}{\hat{\mathds{I}}}
57 \newcommand{\entropy}{\mathds{H}}
58 \newcommand{\empentropy}{\hat{\mathds{H}}}
59 \newcommand{\ganG}{\mathbf{G}}
60 \newcommand{\ganD}{\mathbf{D}}
61 \newcommand{\ganF}{\mathbf{F}}
63 \newcommand{\dkl}{\mathds{D}_{\mathsf{KL}}}
64 \newcommand{\djs}{\mathds{D}_{\mathsf{JS}}}
66 \newcommand*{\vertbar}{\rule[-1ex]{0.5pt}{2.5ex}}
67 \newcommand*{\horzbar}{\rule[.5ex]{2.5ex}{0.5pt}}
69 \def\positionalencoding{\operatorname{pos-enc}}
70 \def\concat{\operatorname{concat}}
71 \def\crossentropy{\LL_{\operatorname{ce}}}
78 {\Large Self-Generated Culture}
86 \centerline{\color{red}(work in progress, to be updated)}\\[3ex]
88 \centerline{\url{https://fleuret.org/public/culture/culture.pdf}}
92 \section{Introduction}
94 The hypothesis behind this experiment is that high-level abstract
95 thinking is fueled by social competition. A group of communicating
96 agents that try to demonstrate their cognitive superiority would end
97 up developing a rich and consistent culture.
99 The experiment is designed with a group of GPTs that alternatively
100 learn to solve quizzes and generate new ones.
102 A ``quiz'' is a triplet of the form $(A, d, B)$ where $A$ and $B$ are
103 two sequences and $d$ is a token indicating if the direction is
104 forward or backward. Given $(A, d)$, the challenge is to generate $B$.
106 The experiments starts with a set of quizzes, that is going to be
107 progressively enriched.
111 The initial set of quizzes consist of predicting the dynamics of a
112 very simple world: A $6 \times 8$ grid with three colored ``birds'' moving in
113 a straight line, possibly bouncing on the grid's borders. There are
114 ten different colors.
117 \includegraphics[scale=0.35]{pics/examples_train.png}
123 In each on these quizzes, $A$ is the left image serialized in
124 raster-scan order as a sequence of $6 \times 8 = 48$ tokens, $d$ is
125 either the token ``forward'' or the token ``backward'', and $B$ is the
126 right image, also serialized. The direction of prediction is chosen at
129 \section{Generating Quizzes}
131 Given a set of $N$ GPTs, we can generate new quizzes as follows:
132 Select one of the models, and use it to generate the $97$ tokens of a
135 Then with each one of the $N-1$ other models, predict $B$ from $(A,
136 d)$, and $A$ from $(B, d')$ where $d'$ is the direction token opposite
139 A quiz is validated if \textbf{all the other GPTs but one predict it
140 deterministically correctly in both directions.}
142 This criterion assures that the new quizzes are both solvable and
143 sophisticated, and incrementally complexify the culture. Imposing both
144 direction prevents the generation of quizzes which are not trivial
145 only because the prompt has been randomly degraded.
147 \section{Overall Process}
149 The overall process consists of training the GPTs from scratch by
150 iterating the following steps:
154 \item select the GPT with the lowest recorded test accuracy, train it through one epoch,
156 \item if its test accuracy gets above $97.5\%$, generate $1'000$ new
157 quizzes, add them to the training set, re-compute the accuracy of
164 This procedure results in the discovery of patterns which are not
165 present in the original quizzes:
170 \includegraphics[scale=0.35]{pics/4_birds_1.png}
171 \includegraphics[scale=0.35]{pics/5_birds_1.png}
173 \includegraphics[scale=0.35]{pics/6_birds_1.png}
176 \textbf{New bird shapes}
180 \includegraphics[scale=0.35]{pics/other_shapes_2.png}
181 \includegraphics[scale=0.35]{pics/other_shapes_3.png}
187 \includegraphics[scale=0.35]{pics/other_shapes_1.png}
188 \includegraphics[scale=0.35]{pics/occlusions_1.png}
193 The code is available at\\[-2ex]
195 \centerline{\url{https://fleuret.org/git/culture}}
197 The experiments are done with a GTX 4090.
199 The GPT used has 37M parameters and the following structure:
203 \texttt{dim\_model} & 512 \\
204 \texttt{dim\_keys} & 64 \\
205 \texttt{dim\_hidden} & 2048 \\
206 \texttt{nb\_heads} & 8 \\
207 \texttt{nb\_blocks} & 12
211 Adam, $\eta = 1e-4$, no scheduling.
213 There are $N_{\text{train}}=250'000$ original quizzes for training and
214 $N_{\text{test}} = 10'000$ for test.
216 At each epoch, for both train and test samples, we mix original
217 quizzes and the generated ones.
219 For training for instance, if there are less than $N_{\text{train}}/2$
220 new quizzes, we take all of them, otherwise we sample
221 $N_{\text{train}}/2$ of them without replacement, and then we sample
222 without replacement enough original quizzes to get $N_{\text{train}}$
225 We proceed similarly to get $N_{\text{test}}$ samples for test.