\documentclass[usenames,dvipsnames]{article}
\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx} % Required for inserting images
\usepackage{float} % For exact placement of tutorial figures



\usepackage{bm}
\usepackage{frcursive}
\usepackage{xfrac}
\usepackage{mathrsfs}
\usepackage{mathtools}

\usepackage{fancyvrb}
\usepackage{xspace}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{cancel}


%\usepackage{xcolor}
\usepackage{minted}



\usepackage[round,authoryear]{natbib}
\usepackage{hyperref}
\hypersetup{colorlinks=true, linkcolor=NavyBlue, citecolor=ForestGreen, urlcolor=blue}
\usepackage{tikz}
\usetikzlibrary{arrows, fit, positioning, shapes, calc, backgrounds}




\title{Sensor Prediction is Enough for Emergent Awareness or Understanding of the World}
\author{Nando de Freitas and Codex}
\date{\today}

\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}

\newcommand{\myvec}[1]{\mathbf{#1}}
\newcommand{\myvecsym}[1]{\boldsymbol{#1}}
\newcommand{\mytensor}[1]{\mathbf{\tilde{#1}}}

\newcommand{\vk}{\myvec{\textcolor{SeaGreen}{k}}}
\newcommand{\rvk}{\myvec{\textcolor{SeaGreen}{k}}}

\newcommand{\vx}{\myvec{\textcolor{ForestGreen}{x}}}
\newcommand{\rvx}{\myvec{\textcolor{ForestGreen}{x}}}
\newcommand{\vz}{\myvec{\textcolor{Red}{z}}}
\newcommand{\vh}{\myvec{\textcolor{Cyan}{h}}}
\newcommand{\vc}{\myvec{\textcolor{purple}{c}}}
\newcommand{\rvz}{\myvec{\textcolor{Red}{z}}}
\newcommand{\vy}{\myvec{\textcolor{Magenta}{y}}}
\newcommand{\rvy}{\myvec{\textcolor{Magenta}{y}}}
\newcommand{\vs}{\myvec{\textcolor{Cyan}{s}}}
\newcommand{\rvs}{\myvec{\textcolor{Cyan}{s}}}
\newcommand{\vu}{\myvec{\textcolor{orange}{u}}}
\newcommand{\vv}{\myvec{\textcolor{Cyan}{v}}}
\newcommand{\rvv}{\myvec{\textcolor{Cyan}{v}}}


\newcommand{\vzero}{\myvec{\textcolor{olive}{0}}}
\newcommand{\vI}{\myvec{\textcolor{olive}{I}}}

%\newcommand{\vtheta}{\myvec{\vtheta}}
\newcommand{\vvarphi}{\myvecsym{\textcolor{NavyBlue}{\varphi}}}
\newcommand{\vtheta}{\myvecsym{\textcolor{blue}{\theta}}}
\newcommand{\valpha}{\myvecsym{\textcolor{purple}{\alpha}}}
\newcommand{\vsigma}{\myvecsym{\textcolor{purple}{\sigma}}}
\newcommand{\vepsilon}{\myvecsym{\textcolor{CarnationPink}{\epsilon}}}
\newcommand{\vmu}{\myvecsym{\textcolor{teal}{\mu}}}

\newcommand{\loss}{{\cal L}}
\newcommand{\gauss}{\mathcal{N}}
\newcommand{\E}{\mathbb{E}} % \E{f(x)}
\newcommand{\pT}{p_{\vtheta}}


\newcommand{\be}{\begin{equation}}
\newcommand{\ee}{\end{equation}}
% for cormen.cls, we define
%\newcommand{\be}{\begin{eqnarray}}
%\newcommand{\ee}{\end{eqnarray}}
% NOTE that use of eqnarray causes issues with \label and \cref

\newcommand{\bea}{\begin{eqnarray}}
\newcommand{\eea}{\end{eqnarray}}
\newcommand{\beaa}{\begin{eqnarray*}}
\newcommand{\eeaa}{\end{eqnarray*}}
\newcommand{\ba}{\begin{align*}}
\newcommand{\ea}{\end{align*}}



% Macros for consistent formatting
\newcommand{\action}{\textbf{\textcolor{red}{$a$}}}
%\newcommand{\vx}{\textbf{\textcolor{ForestGreen}{$x$}}}
\newcommand{\reward}{\textbf{\textcolor{purple}{$r$}}}
\newcommand{\nextaction}{\textbf{\textcolor{red}{$a'$}}}
\newcommand{\nextobs}{\textbf{\textcolor{ForestGreen}{$o'$}}}
\newcommand{\params}{\textbf{\textcolor{blue}{$\theta$}}}
\newcommand{\return}{\textbf{\textcolor{cyan}{R}}}



% Extra macros for this awareness tutorial
\graphicspath{{sensor_awareness_tutorial_assets/}}
\newcommand{\obsdist}{p_{\vtheta}}
\newcommand{\probe}{q_{\vvarphi}}
\newcommand{\futureobs}{\vx_{t+1:t+k}}
\newcommand{\history}{\vx_{\leq t},\vu_{<t}}
\newcommand{\compress}{\mathsf{compress}}
\newcommand{\predict}{\mathsf{predict}}
\newcommand{\world}{\mathsf{world}}
\newcommand{\sensors}{\mathsf{sensors}}
\newcommand{\notarget}{\textcolor{Red}{\mathsf{not\;a\;training\;target}}}
\newcommand{\target}{\textcolor{ForestGreen}{\mathsf{training\;target}}}
\newcommand{\paperfaithful}{\textcolor{NavyBlue}{\mathsf{paper\mbox{-}faithful}}}

\begin{document}

\maketitle

\begin{abstract}
This note revisits the paper \emph{Learning Awareness Models}, but this time with a two-arm ALOHA robot. The Mujoco environment, experiments and training of AI models were generated with GPT5.5 in less than a day. Before coding agents existed, it took a diverse team of engineers more than a month to complete this task in DeepMind. A recurrent dynamics model is trained to predict only the robot's future body readings, while it blindly touches a series of unknown objects.  The model does \emph{not} predict the object label, pose, size, mesh, or full world state.  Emergent awareness is measured as in the awareness paper: freeze the dynamics model, look at its hidden states, and ask whether a diagnostic probe can decode the unobserved object.  This is the robotics analogue of LLM pretraining: a model trained for next-token prediction is forced to build compressed representations of latent structure in text (what Ilya Sutskever correctly refers to as understanding). Here, a model trained for next-sensor-reading prediction is forced to build compressed representations of latent structure in physical interactions.
\end{abstract}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Introduction: why this is emergent awareness}

Endsley's classic definition of situation awareness emphasizes perceiving elements in space and time, understanding their meaning, and projecting their status into the near future \citep{endsley1987sagat}.  \citet{amos2018awareness} turn this into an operational learning problem.  An agent has a stable body, a changing outside world, and sensors at the boundary between the two.  The external world is usually not directly available to the agent.  The body sensors are.

The important claim is not that the model learns a labeled world simulator.  The claim is sharper:

\be
\boxed{
\begin{array}{c}
\text{A compressed predictor of the agent's own sensors}\\[1mm]
\text{can develop representations of the external causes of those sensors.}
\end{array}}
\label{eq:compressed-predictor-slogan}
\nonumber
\ee

This is \emph{emergent} awareness because the object variables are never the optimization target for the dynamics model.  Object identity, geometry, and pose become useful because they explain future tactile and force readings.  In the accompanying notebook, the hidden variables are object class and random geometry,

\be
\begin{aligned}
\underbrace{\vy_t = \text{shape, size, yaw, pose, seed}}_{\notarget}
\\
\underbrace{\vx_t = \text{touch, force, torque, proprioception}}_{\target}
\nonumber
\end{aligned}
\ee

The analogy with language models is direct.  A transformer is not explicitly trained to output a world database; it is trained to predict tokens.  Yet, to predict tokens well, its hidden states must compress facts, relations, intentions, syntax, and physical regularities that explain the text.  Sutskever's defense of next-token prediction is precisely that prediction of the observable stream can require deep internal structure \citep{sutskever2023dwarkesh}.  The robot version replaces tokens with sensors:

\be
\boxed{
\begin{aligned}
\textcolor{NavyBlue}{\loss_{\rm LM}(\vtheta)}
&= -\sum_i \log p_{\vtheta}(w_{i+1}\mid w_{\leq i}),
&\textcolor{NavyBlue}{\vh_i} &= T_{\vtheta}(w_{\leq i}),\\[1mm]
\textcolor{ForestGreen}{\loss_{\rm sensor}(\vtheta)}
&= -\sum_t \log \obsdist(\vx_{t+1}\mid \vx_{\leq t},\vu_{\leq t}),
&\textcolor{ForestGreen}{\vh_t} &= F_{\vtheta}(\vx_{\leq t},\vu_{<t}).
\end{aligned}}
\label{eq:lm-robot-analogy}
\ee

Both objectives are self-supervised prediction of what the model is allowed to observe.  The latent structure appears inside the activations \(\vh\) because \(\vh\) is the bottleneck through which prediction must pass.

\section{The awareness protocol}

The awareness paper defines a discrete-time system with global state \(\vs_t\), observation \(\vx_t\), action \(\vu_t\), and unobserved state \(\vy_t\) \citep{amos2018awareness}.  The dynamics model predicts action-conditional future observations:

\be
\boxed{
\obsdist(\futureobs \mid \vu_{1:t+k-1},\vx_{1:t})
}
\label{eq:awareness-dynamics-objective}
\ee

Awareness is then defined as information about unobserved states represented by the dynamics model.  The diagnostic model is only a measurement device:

\be
\boxed{
\probe(\vy_t\mid \vh_t)
\qquad
\text{with}\quad
\vh_t = F_{\vtheta}(\vx_{1:t},\vu_{1:t-1})
\quad\text{and}\quad
\vtheta\;\text{frozen}.}
\label{eq:diagnostic-probe}
\ee

The freeze is essential.  If the diagnostic loss changes \(\vtheta\), then the model has simply been trained to classify objects.  That would be ordinary supervised learning, not emergent awareness.  The paper's test is: train the dynamics model on observed states only, freeze it, and then ask whether object properties can be decoded from its internal states \citep{amos2018awareness}.

\begin{figure}[t!]
\centering
\resizebox{0.98\textwidth}{!}{%
\begin{tikzpicture}[node distance=1.2cm, >=stealth, thick]
    \tikzstyle{worldnode}=[draw=Red, fill=red!6, rounded corners, minimum width=3.5cm, minimum height=1.0cm]
    \tikzstyle{sensornode}=[draw=ForestGreen, fill=green!7, rounded corners, minimum width=3.6cm, minimum height=1.0cm]
    \tikzstyle{hiddennode}=[draw=Cyan, fill=cyan!7, rounded corners, minimum width=3.7cm, minimum height=1.0cm]
    \tikzstyle{prednode}=[draw=NavyBlue, fill=blue!6, rounded corners, minimum width=4.0cm, minimum height=1.0cm]
    \tikzstyle{probe}=[draw=purple, fill=purple!6, rounded corners, minimum width=4.0cm, minimum height=0.9cm]
    \node[worldnode] (world) {unobserved object \(\vy_t\)};
    \node[sensornode, right=1.7cm of world] (sensors) {body sensors \(\vx_t\)};
    \node[hiddennode, right=1.7cm of sensors] (state) {compressed state \(\vh_t\)};
    \node[prednode, right=1.7cm of state] (pred) {future sensors \(\hat{\vx}_{t+1:t+k}\)};
    \node[probe, below=1.15cm of state] (diag) {diagnostic \(\probe(\vy_t\mid\vh_t)\)};
    \draw[->, Red, dashed] (world) -- node[above, font=\small] {causes contacts} (sensors);
    \draw[->, ForestGreen] (sensors) -- node[above, font=\small] {observed} (state);
    \draw[->, orange] (sensors.south east) to[bend right=17] node[below, font=\small] {actions \(\vu_t\)} (state.south west);
    \draw[->, NavyBlue] (state) -- node[above, font=\small] {decode} (pred);
    \draw[->, purple, dashed] (state) -- node[right, font=\small] {after freeze} (diag);
    \draw[->, Red, dashed] (world.south) to[bend right=20] node[below, font=\small] {labels only here} (diag.west);
\end{tikzpicture}}
\caption{The paper-faithful awareness protocol.  The green path is the training path: body sensors and actions are compressed into \(\vh_t\), which predicts future body sensors.  The red object variable is a latent cause of those sensors, not a target.  The purple diagnostic is trained only after the dynamics model is frozen.}
\label{fig:awareness-protocol}
\end{figure}

\section{The two-arm setup}

Each episode samples one hidden object and executes a scripted multi-touch probing trajectory.  The observation is body-only.  The experiment uses:

{\tiny
\begin{center}
\begin{tabular}{|l|l|}
\hline
body & two mirrored 7-DoF ALOHA-style arm chains with grippers \\
\hline
hidden object classes & box, cylinder, ellipsoid, dumbbell, cross, toy\_elephant \\
\hline
observation dimension & 78 = 64 MuJoCo sensor channels + 14 external-torque proxy channels \\
\hline
action dimension & 14 normalized actuator controls \\
\hline
dataset & 192 episodes, 200 actions per episode, 32 episodes per object class \\
\hline
frozen state size & 128 recurrent units \\
\hline
\end{tabular}
\end{center}
}

The camera frame strip in Figure~\ref{fig:two-arm-setup} is the most important sanity check: the two grippers approach the hidden object from opposite sides, make contact, release, and repeat.  The model will not see these rendered pixels.  The images are for us, not for the learning algorithm.

\begin{figure}[H]
\centering
\includegraphics[width=\textwidth]{aloha.png}
\caption{Top-camera frame strip for a \texttt{toy\_elephant} episode.  The scene contains two arms, a pedestal-mounted object, palm/fingertip touch sites, and wrist force-torque sites.  The dynamics model does not receive camera pixels; it receives only the body-sensor vector.}
\label{fig:two-arm-setup}
\end{figure}

The experiment's PreCo-style model uses two recurrent operations.  The predictor advances the hidden state using the action; the corrector incorporates the next observation.  A decoder maps the predicted hidden state to a Gaussian prediction over the next normalized observation:

\be
\boxed{
\begin{aligned}
\textcolor{orange}{\text{predict:}}\qquad
\vh^p_{t+1} &= \mathrm{GRU}_{p,\vtheta}\big(e_u(\vu_t),\vh^c_t\big),\\[1mm]
\textcolor{NavyBlue}{\text{decode:}}\qquad
(\vmu_{t+1},\log \vsigma_{t+1}) &= D_{\vtheta}(\vh^p_{t+1}),\\[1mm]
\textcolor{ForestGreen}{\text{correct:}}\qquad
\vh^c_{t+1} &= \mathrm{GRU}_{c,\vtheta}\big(e_x(\vx_{t+1}),\vh^p_{t+1}\big).
\end{aligned}}
\label{eq:preco-gru}
\ee

The per-channel prediction loss is a Gaussian negative log likelihood on sensor readings. Following awareness paper, the experiment adds loss terms for predicted futures rolled out for several steps  \citep{amos2018awareness}.
The optional touch-event term is still a sensor target.  It asks whether the body is touching, not which object it is touching.  

\be
\boxed{
\textcolor{Red}{\cancel{\loss_{\rm world}(\vtheta)
= -\log p_{\vtheta}(\vy_t\mid\vx_{\leq t},\vu_{<t})}}
\qquad
\textcolor{ForestGreen}{\loss_{\rm sensor}(\vtheta)
= -\log p_{\vtheta}(\futureobs\mid\history).}}
\label{eq:not-world-prediction}
\nonumber
\ee

This is the point of the experiment.  We are not predicting the \(\world\).  We are predicting what \(\sensors\) are likely to perceive.


\section{Prediction plots: the model anticipates contact consequences}

Figure~\ref{fig:prediction-check} shows one-step predictions on a held-out episode.  The orange curves are the predicted means; the blue curves are recorded sensor values.  The model is imperfect, but it learns the timing and approximate magnitudes of many contact-induced channels.  This is the same logical role as next-token prediction: the prediction is local and observable, but good performance requires the hidden state to summarize latent causes that are not directly labeled.

\begin{figure}[H]
\centering
\includegraphics[height=0.90\textheight]{fig_prediction_check.png}
\caption{One-step prediction check on a held-out episode.  The selected channels include palm touch, fingertip touch, wrist force-torque, and external-torque proxy channels.  The model is trained to predict these body readings from body history and actions, not to predict the object class or full physical state.}
\label{fig:prediction-check}
\end{figure}

\section{Diagnostics and latent projections}

The awareness measurement asks whether the latent embeddings of the network \(\vh_t\), trained with Eq.~\eqref{eq:sensor-loss}, carry information about \(\vy_t\).  The notebook trains a probe

\be
\boxed{
\vvarphi^* = \arg\min_{\vvarphi}
\Big[-\log \probe(\vy \mid \vh)\Big]
}
\label{eq:probe-training}
\ee

This diagnostic does not create awareness; it measures whether awareness is already present in the frozen dynamics state.  In the attached notebook output, the quick run reached an overall shape-diagnostic accuracy of about \(0.403\), compared with chance \(1/6\approx 0.167\).  The PCA plot is not a proof, but it gives an intuitive visualization: episode-averaged frozen states cluster by object class.

\begin{figure}[H]
\centering
\begin{minipage}{0.52\linewidth}
\centering
\includegraphics[width=\linewidth]{fig_diagnostic_accuracy.png}
\end{minipage}\hfill
\begin{minipage}{0.42\linewidth}
\centering
\includegraphics[width=\linewidth]{fig_latent_projection.png}
\end{minipage}
\caption{Left, diagnostic accuracy over time from frozen dynamics states. Right, a two-dimensional PCA projection of episode-averaged frozen PreCo states colored by hidden object class.  The diagnostic is a post-hoc probe.  It should not feed gradients back into the sensor-prediction model.}
\label{fig:diagnostic-pca}
\end{figure}

The projection is the spatial picture requested in the prompt: different hidden objects occupy different regions of the frozen representation space.  The model was not asked to construct this space.  It appears because object identity changes future sensor traces, and the recurrent state must compress whatever information helps it predict those traces.

\section{Why this is not a world model}

A full world model would try to represent every relevant hidden variable: the object mesh, pose, friction, mass, exact contacts, and perhaps the whole simulator state.  That is not the tutorial's claim.  The claim is more minimal and more interesting:

\be
\boxed{
\begin{array}{rcl}
\textcolor{Red}{\text{world prediction}} &:& \textcolor{Red}{p_{\vtheta}(\vs_{t+1}\mid \vs_t,\vu_t)} \quad \text{requires privileged state,}\\[1mm]
\textcolor{ForestGreen}{\text{sensor prediction}} &:& \textcolor{ForestGreen}{p_{\vtheta}(\vx_{t+1:t+k}\mid \vx_{\leq t},\vu_{<t+k})} \quad \text{requires only the agent's stream.}
\end{array}}
\label{eq:sensor-not-world}
\nonumber
\ee

Only those aspects of the world that matter for future sensors need to enter \(\vh_t\).  Awareness is therefore selective.  A hidden object's color may be irrelevant to a blind tactile robot; its shape, pose, and stiffness may matter because they determine future touch and force.  The awareness paper's conclusion is exactly this: a forward predictive model of proprioception can yield features that support reasoning about external objects \citep{amos2018awareness}.

\section{Takeaway}

The notebook is a small tactile analogue of transformer pretraining.  We do not ask for a world description.  We ask for prediction through a bottleneck:

\be
\boxed{
\begin{aligned}
\compress\big(\text{past obs/actions}\big)
&\xrightarrow{\;\predict\;}
\text{future sensor readings}\\[1mm]
&\Longrightarrow
\text{latent object causes become useful.}
\end{aligned}}
\ee

When a frozen hidden state trained only for sensor prediction supports post-hoc decoding of unobserved object properties, that is emergent awareness in the sense of \citet{amos2018awareness}.  The model is not predicting the world.  It is predicting what its sensors are likely to perceive; the world appears inside the representation only insofar as it is needed for that prediction.

\begin{thebibliography}{99}

\bibitem[Amos et~al.(2018)]{amos2018awareness}
Brandon Amos, Laurent Dinh, Serkan Cabi, Thomas Roth{\"o}rl, Sergio G{\'o}mez Colmenarejo, Alistair Muldal, Tom Erez, Yuval Tassa, Nando de Freitas, and Misha Denil.
\newblock Learning awareness models.
\newblock In \emph{International Conference on Learning Representations}, 2018.

\bibitem[Brown et~al.(2020)]{brown2020language}
Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et~al.
\newblock Language models are few-shot learners.
\newblock In \emph{Advances in Neural Information Processing Systems}, 2020.

\bibitem[Endsley(1987)]{endsley1987sagat}
Mica R. Endsley.
\newblock SAGAT: A methodology for the measurement of situation awareness.
\newblock Technical Report NOR DOC 87-83, Northrop Corporation, 1987.

\bibitem[Kingma and Ba(2014)]{kingma2014adam}
Diederik P. Kingma and Jimmy Ba.
\newblock Adam: A method for stochastic optimization.
\newblock arXiv preprint arXiv:1412.6980, 2014.

\bibitem[Radford et~al.(2019)]{radford2019language}
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever.
\newblock Language models are unsupervised multitask learners.
\newblock OpenAI technical report, 2019.
\newblock \url{https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf}.

\bibitem[Sutskever and Patel(2023)]{sutskever2023dwarkesh}
Ilya Sutskever and Dwarkesh Patel.
\newblock Ilya Sutskever: why next-token prediction could surpass human intelligence.
\newblock \emph{Dwarkesh Podcast}, 2023.
\newblock \url{https://www.dwarkesh.com/p/ilya-sutskever}.

\bibitem[Todorov et~al.(2012)]{todorov2012mujoco}
Emanuel Todorov, Tom Erez, and Yuval Tassa.
\newblock MuJoCo: A physics engine for model-based control.
\newblock In \emph{IEEE/RSJ International Conference on Intelligent Robots and Systems}, pages 5026--5033, 2012.

\bibitem[Vaswani et~al.(2017)]{vaswani2017attention}
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan~N. Gomez, Lukasz Kaiser, and Illia Polosukhin.
\newblock Attention is all you need.
\newblock In \emph{Advances in Neural Information Processing Systems}, 2017.

\end{thebibliography}

\end{document}
