Manuscript Offprint
arXiv:2610.34428Matter that learns what matters
Abstract
Can a material learn what deserves its attention? We show that it can in a model optical network, in which action outcomes train a persistent record in each link. The record biases whether a source is consulted and sets how strongly it changes a stored answer, so useful sources gain attention and influence without being identified in advance. The network's experience thus shapes the information available for its future learning. Resonant readouts make this learning fragile: reinforcement can carry a record past resonance, where it persists but its influence weakens. We derive bounds within which relevant signals guide the answer, irrelevant signals are rejected and stored answers remain open to revision. These bounds guide a learning rule that limits reinforcement as records form; in simulations, it acquires useful records and keeps them functional. When relevance changes, an obsolete record can block its own replacement. A local state that strengthens negative writing after unsuccessful actions releases obsolete records and completes the learning sequence more often. How a memory is read should decide how it is written.
An animal searching for food hears many sounds, but only a few tell it where to look. It must learn from experience which signals to examine and how strongly an observation should change what it remembers [1–3]. Physical materials can also learn [4]. Mechanical, flow, electrical and optical networks retain records of past forcing and can be trained to give a required response [5–15]. Some learn from reward [16, 17]. Local learning rules have also been demonstrated [9, 15, 17–20], in some cases without a processor [9, 18]. In these systems, whether trained by examples, targets or rewards [16, 17] or adapting to their inputs [19, 20], the learned state shapes the response to whatever input arrives. Here, by contrast, a persistent material state trained by action outcomes governs both which source is consulted and how strongly that source can change a stored answer.
Optical cavities coupled to excitation reservoirs have been used for neuromorphic computing [21, 22]. In optical networks, a stored state can route incoming light [20]. Optical reservoir computers have also used reward to select among pretrained readouts or learn control policies, with readout weights trained off-chip [23, 24]. Here we ask a different question: can the outcomes of a material's own actions train a persistent physical state that governs the material's intake of information, deciding which external source is read and how strongly it changes a stored answer? We call this endogenous information control. It is the physical counterpart of learned attention in the psychological sense, the learned selection and weighting of information sources [1, 2], not the attention mechanism of transformer networks: the material's stored experience sets which information it takes in and how far it trusts it, so that experience shapes the evidence available for its future learning. We show it in a model network of optical cavities (Fig. 1; the terms used throughout are collected in Table 1). The model's analysis also yields a design principle for any memory that is read through a resonance.
The network repeatedly answers two yes-or-no questions about hidden binary values. We call each question a need and label the two E and I; two needs let us test whether learning for one interferes with the other. Each need has an optical answer memory: a degenerate parametric oscillator whose stable phases, 0 and , represent yes and no (Methods). Three input beams, the sources, carry binary signals in their phase. For each need, one source is valid: it tracks the corresponding hidden value. The two needs have different valid sources, while the third source is unrelated to both. These pairings define the assignment. Because the hidden values change at random, the network must keep consulting sources. It does best by consulting the valid source and allowing only that source to change its answer.
Every source connects to both answer memories through separate optical links. Each link contains a cavity and a second resonator, the reader, which couples the source to the answer memory. Absorbed light fills a reservoir of excitations shared by the cavity and the reader, whose population forms the link's persistent relevance record. Changes in this population shift both resonances, as long-lived excitons blueshift optical modes in polariton microcavities [25, 26]. The cavity is probed at a fixed frequency, so its response depends on the record and biases source selection. The reader couples to a source field at a fixed frequency, so the same record sets how strongly an ordinary reading changes the answer (Fig. 1a).
The experimenter sets the timing of sensing, reading and feedback, with the needs acting in turn (Fig. 1b,c). Each cycle begins with a weak probe of the acting need's links. Their cavity responses determine the probability of selecting each source through a fixed rule that favours stronger responses (Methods). The selected source then acts on both answer memories through its readers. An external scorer checks the acting need's answer against the correct answer.
Each link keeps a trace, a temporary signal that marks its recent activity, such as light in its reader, until feedback arrives. A common outcome signal reaches all links and drives the writer, which weights each record update by the local trace. The writer's outcome signal is positive for correct answers and negative for errors at the operating baseline. The writer's contribution to the record change is the link's credit. A separate correction drive resets only the acting need's answer memory to the correct answer and writes no relevance record. For binary answers, the known action and its score determine the required correction, so the correction supplies no additional task information. The reinforcement threshold makes the mean outcome signal nearly zero when the network merely retains the corrected answer (Methods).
The protocol provides assisted reading: on half of all readings, the acting need's selected reader is tuned to resonance, regardless of which source was chosen. This allows a source to revise a wrong answer and earn credit before its record has formed. Without assistance, even a valid source would initially be too weakly coupled to do so (Supplementary Sections S1.3 and S3.2). The experimenter supplies neither the valid-source assignment nor a target record for any link; the network must infer source relevance from its readings and their outcomes.
These coupled readouts place a physical limit on learning. Reinforcement can carry a record past resonance, where it persists while both readouts weaken: a stored record is not automatically a functional one. We derive sufficient bounds within which fixed records favour valid sources, protect stored answers from irrelevant inputs and permit revision by valid signals. These bounds tell the writer where reinforcement should stop. A self-limiting writer that weakens positive updates as a record forms, and ceases them at a ceiling inside the functional range, acquired functional records in all six initial validation networks and kept them functional through operation before reassignment. When relevance changes, a further obstacle appears: an obsolete record keeps its source favoured and so restricts the readings that could replace it. A local state that strengthens negative writing after adverse outcomes releases such records and completes the full sequence of learning, operation and replacement more often (Fig. 5).
One population stores the record and sets both readouts
Optical bistability allows each link to retain a record under a continuous holding drive. Absorbed light fills the reservoir, whose growing population initially shifts the cavity resonance towards the drive frequency. The resulting increase in absorption reinforces the population growth. When the cavity field relaxes much faster than the reservoir, the balance between filling and decay reduces to
where is the normalised population, the reservoir decay rate, the drive power and the detuning (Methods). At and holding power , this feedback produces two stable populations [27], and , separated by the unstable population (Fig. 1a). In these reduced dynamics, a pulse that raises above is followed by relaxation towards one link

storage by bistability
two readouts of one record
b
same outcome pulse to all six links; each link writes at a rate set by its own trace and record
grey lines: waveguides
C

Figure 1: One population per link controls both source choice and memory revision. a, One link. Left: absorbed light fills a reservoir of excitations (purple balls). Its population x, the relevance record, shifts the cavity and reader resonances relative to the fixed frequencies of the drive, probe and source field. Middle: optical bistability, Eq. (1), shown as motion in the effective potential . Its minima are the stable populations of the unformed , dashed circle) and formed , filled circle) records. Outcome pulses can push the record across the barrier at . Right: the two readouts, normalised to their peaks. The cavity's probe response is proportional to the sensing signal and biases source choice. The reader gain , shown for width , sets how strongly the source moves the answer. Both peak near resonance. Green marks the range proved at , with valid records in [3.30, 3.70], where both readouts work (the functional window, Fig. 4). Beyond this range (arrow), a record can stay formed but cease to be useful (open circle). b, Network crossbar. Source lines (columns; only the selected one is open) cross memory lines (rows, one per need). At each crossing, a cavity holds a reservoir of population , and a reader resonator couples the lines efficiently only near resonance. The reader's glow represents the activity recorded by the trace under the admission rule. (1) The probe of the acting need E gives the sensing signals (blue bars): cavity intensities proportional to in panel a. (2) A supplied rule, Eq. (11), selects a source. It pushes memory E strongly through the formed link and memory I weakly through the unformed one. The source reaches both memories, but the records determine which memory it can change. (3) The phase of memory E is scored. (4) One outcome pulse, a proposed device operation, reaches all six links; each writes at a rate , Eq. (3). (5) The correction drive resets memory E; it writes no record. c, Timing of one decision cycle and the role of the record in each step; assisted reading bypasses the record of the selected reader.
Table 1: Glossary. The model's parts and the terms used for them. Symbols refer to the network equations in Methods.
| Term | Meaning |
|---|---|
| Need (E, I) | One of the two yes-or-no questions the network answers in turn. The acting need is the one answered in the current cycle. |
| Source | One of three input beams carrying a binary signal in its phase. A source is valid for a need if it tracks that need's hidden value; the assignment pairs each need with its valid source. The third source is unrelated to both needs. |
| Answer memory | Degenerate parametric oscillator of need ; its phase, or , stores the current answer. |
| Link | Optical path from source to the memory of need (six in all). Contains a cavity, a reader and a reservoir. |
| Cavity | Resonator under a continuous holding drive. Probed at a fixed frequency during sensing; its response biases which source is selected. |
| Reader | Second resonator coupling source to memory ; its gain sets how strongly the source moves the answer. |
| Relevance record | Reservoir population shared by the cavity and reader of a link. It shifts both resonances and is the learned state. Formed when . |
| Sensing, protection, revision | The three readout functions: a valid record wins source selection; non-valid readings cannot reverse a stored answer; a valid reading can revise it. The functional window is the record range in which all three hold. |
| Trace | Temporary local signal marking a link's recent activity until the outcome arrives. Three variants: co-presence (cavity light), admission (reader light), use (reader work on the answer). |
| Writer | Outcome pulse, common to all links, weighted by each link's trace; it changes the record. The self-limiting writer weakens positive writing as a record forms. |
| Correction drive | Resets the acting memory to the correct answer after scoring. Writes no record. |
| Assisted reading | On half of all readings, the selected reader is tuned to resonance, letting a source act before its record has formed. |
| Adverse-outcome susceptibility | Local signed state raised by adverse outcomes; its positive part strengthens negative writing on that link. |
. The holding drive sustains the high population after the pulse ends. We call a record formed when .
At a fixed population, the settled cavity response to the probe is proportional to , and the selection rule favours stronger responses. The same population also shifts the reader resonance, setting the selected source's influence on the answer memory.
Without reader or correction drives, the answer memory of need has stable states , corresponding to phases and . Source carries the value and connects to this memory through a link with population . When the reader relaxes much faster than the population and answer memory, its contribution during an unassisted reading is approximately
where while source is read and otherwise. The response is , with reader width and peak gain . In the reduced dynamics of the real answer coordinate, the gain acts like the stiffness of a spring pulling the answer towards the source value. A weak pull can leave the answer in its original well. A sufficiently strong pull removes the stable state with sign opposite to the source, allowing the answer to change (Methods).
For settled cavity fields at equal drive power, the sensing response at is 5.83 times that at . The corresponding reader-gain ratio is 9 at and about 23 at (Fig. 1a). The two readouts peak at different populations: sensing at the probe resonance, , and reader gain at . The reader is tuned by design so that its gain peaks at the formed population, where a valid record should rest, whereas the probe detuning is fixed by the bistability condition; the two peaks therefore need not coincide. Further growth beyond both peaks weakens both readouts without erasing the record. The six populations , shaped by action outcomes, carry the network's learned relevance (criteria D1–D5, Methods).
Here is the acting need, and is a running average of its designated-guess scores. The margin places the reinforcement threshold above this baseline. Initially, , giving for a correct answer and for an error. The gain sets the writing strength, and during the pulse and 0 otherwise.
Each link weights the common signal by its own eligibility trace . This trace retains a temporary measure of recent activity and decays with lifetime when its drive ceases. The factor , with , vanishes at zero and prevents the writer from driving the population negative (Methods). Equation (3) follows the logic of three-factor synaptic learning, in which delayed reward acts on connections tagged by recent activity [28–31]. A physical trace must retain the activity signal until the outcome arrives, as proposed using the resistance drift of phase-change devices [32] (Supplementary Section S8).
We compare three signals for driving the trace. Co-presence measures cavity intensity above the holding-drive background. Admission measures reader intensity. Use measures the reader's contribution to motion of the answer. Admission and use are driven only while the link's need is acting (Methods). These rules test whether credit should depend on illumination, reading or the effect of reading on memory.
Figure 2a,b follows one admission network from unformed records. Both valid records rise above , while the four non-valid records remain unformed. As each valid record forms, its need comes to select the valid source most of the time: in unassisted cycles, need E selects its valid source with probability 0.40 before the record forms and 0.88 afterwards. The formed records also allow the valid sources to revise their answers without assistance (Supplementary Fig. S2).
A transplant tests whether the populations themselves carry both source preference and influence on memory (Fig. 2c,d). Each pair contains two networks trained on exchanged source assignments. We test one recipient with its own six populations, with its partner's and with all six set to their mean, using matched preparations of the answer memories, traces and fast fields. Only the populations are transplanted.
Both functions followed the transplanted records rather than the recipient's training in all eight pairs of the first admission test, whose criteria were fixed before the runs. After the exchange, the newly preferred source's sensing signal exceeded its strongest competitor by a factor of 2.35 to 4.0, and the source valid under the transplanted pattern moved its memory by 2.00 in every pair, against at most 0.019 for the others. Setting all six populations to their mean removed the selectivity. At the reference step, the same per-pair test passed in 21 of 24 admission pairs of the larger comparison below, and in 15 of the 16 use pairs in which both networks had formed records (Supplementary Section S7.3).
Traces tied to reading produced more selective learning than co-presence. Across 24 networks per rule covering all assignments, admission and use each formed both valid records in 23 networks. At the reference integration step, neither rule produced a persistent false record among its 96 non-valid links.
One network learns where to look: its records over the acquisition period (admission rule)

c Transplant: sensing signal
d Transplant: memory change

Figure 2: Learned populations transfer both source choice and memory influence. a, Records during acquisition (cycles 1–750) in one of the 24 admission networks of Fig. 3, whose traces are driven by reader intensity. Colours: valid records of need E (brown) and need I (magenta), and four non-valid records (grey). Dashed line, ; triangles, the three cycles shown in Supplementary Fig. S2. b, Fraction of each need's readings taken from its valid source, in 25-cycle bins (white 0, full colour 1); the first and last bins are labelled. c,d, Transplant in the first eight-pair admission test, with criteria fixed before the runs. Each pair contains two networks trained on exchanged assignments. One network per pair is tested with its own records, its partner's six records (records exchanged) and all six records set to their mean (all records equal). Memories, traces and fast fields are matched; only the reservoir populations are exchanged. c, Sensing signal , the cavity intensity of source k, measured two time units after the named need's probe is switched on, with readers off. d, Memory change: the largest change of , the answer memory of need j, over the two signs of the source value after a ten-unit reading with the probe off. With equal records, every source changes the memory (Supplementary Section S7.3). Full network equations with noise (Methods; reference parameters, w = 1). Panels a,b show a single realisation, recomputed with logging that leaves the dynamics unchanged (Supplementary Section S9.2). Panels c,d show means over the eight pairs; ranges are given in the text. No error bars.
Co-presence formed both valid records in 13 networks and left 34 persistent false records (Fig. 3a–c). Shuffling the scores supplied to each writer preserved their mean but broke their association with the readings they scored. All three rules then formed persistent false records, showing that the average score alone does not determine what is learned (Supplementary Section S7.2).
Under admission and use, reading drives a link’s trace only while its need is acting. This limits interference from the other need’s outcomes and helps formed records persist. Under both rules, the readers also improve performance: with assisted reading off, disconnecting them reduced the fraction of correct actions by 13–14 percentage points. After reassignment, both rules formed the newly valid source’s record without being told which link had changed (Fig. 3b,d,e; Supplementary Section S7.4).
In these runs, admission retained records more consistently when sources were read one at a time. We therefore use it in the writer studies below. When an unrelated source was read alongside the valid one under the flip protocol, only the use trace met the joint criteria for forming valid records and limiting false records (Supplementary Sections S2 and S7.2).


b

c

d

e

Figure 3: Traces tied to reading support formation, retention and replacement. Twenty-four networks per trace rule at reference parameters ( , ), full noisy network equations (Methods), 3000 decision cycles, learning in cycles 1–750. Trace rules: co-presence (C, cavity light), admission (A, reader intensity) and use (U, reader work on the answer). a, Weaker of the two valid records in each network (thin lines), median (thick line) and 10–90% band; dashed line, ; vertical line, cycle 750. b, Fraction of networks in the correct-only pattern (both valid records formed, no non-valid record formed), 25-cycle moving average. Shading, durability interval (cycles 2501–3000). c, Under separate readings (one source per decision), networks with both valid records formed at cycle 750 and persistent false records among the 96 non-valid links; under co-reading, in which the unrelated source is read together with every valid reading, the same two quantities (48 co-read links); and networks durable to cycle 3000: in the correct-only pattern for at least 400 of cycles 2501–3000 with no persistent false record in cycles 1–3000. Bars give percentages, labels counts. The registered co-reading false-record test applies only when both valid records form in at least 18 of 24 networks; only use meets this condition. d, Reassignment of need E. Its valid source is exchanged with the unrelated source at cycle 2000 and restored at cycle 2751; continuations run to cycle 3500. Medians over 24 networks (9-cycle moving average) of need E's record of its original valid source (solid) and of the unrelated source (dashed), for admission and use. e, Reader contribution to performance. From each network's state at cycles 2000 and 3000, two paired 200-cycle continuations are run, with readers connected and disconnected; both keep the writer and correction drive, and assisted reading is off. Symbols give the mean gain in the fraction of correct actions, including designated guesses, in percentage points; bars mark the one-sided 95% lower bound from a bootstrap over networks. Without readers, a retained corrected answer can still be right. The network is the sampling unit. Curves in a, b and d summarise all networks and have no error bars. Some individual counts vary under step refinement; the aggregate verdicts are unchanged (Supplementary Section S9.1).
Storage stability is not functional stability
Everything so far used the reference reader width . The records learned there form, persist and improve actions when read. Yet they settle near , beyond the peaks of both readouts (Figs. 1a,
2a and 3a). Positive writing continues after formation, while the bistable restoring flow, set by the slow reservoir decay, is too weak to hold the record near (Supplementary Sections S1.1 and S6).
We call a set of records functional if three conditions hold: each need selects its valid source with probability at least (sensing); unassisted non-valid readings cannot reverse a stored answer (protection); and an unassisted valid source can revise the answer within one reading (revision). The set of such configurations is the functional window. The three requirements compete (Fig. 4a–c).
Sensing bounds the record on both sides because its signal peaks at the probe resonance, x = 3. Too far below or above resonance, a valid record no longer outshines its competitors enough. Sensing is therefore guaranteed between lower and upper limits, and , that define the sensing interval. The competing records and supplied selection rule set these limits (Fig. 4a).
Protection depends on the summed gain of the non-valid readers. At w = 1, two readers attached to unformed records can together reverse an answer, although each is harmless alone (Fig. 4b). Under the standard protocol an answer memory receives at most one non-valid reading at a time, which is why the networks learned at w = 1 operate well. We nevertheless require protection against two simultaneous non-valid readings, a margin that also covers reading two sources at once (Methods).
Narrowing the reader leaves its peak gain , at , unchanged but makes the gain fall faster with detuning from . It therefore suppresses the gain of far-detuned unformed records much more than that of valid records near . Valid records, however, occupy a range of populations around rather than itself. Too narrow a reader leaves a valid record near the edge of that range with too little gain to revise the answer within one reading; this sets the lower width limit. Bounds from the reduced equations give a sufficient common width range for protection and revision, , which excludes the reference width (Fig. 4a); narrower readers are not ruled out by these bounds. The remaining studies therefore use . At this width, the full reader and memory equations prove all three requirements for fixed valid records in [3.30, 3.70] (Fig. 4a,c); related bounds cover slowly moving and noisy records under the conditions stated in Methods. These are sufficient conditions for reliable readout, and they pose the learning task sharply: the writer must bring records across the barrier at , into the functional window, and keep them there. The simulations that follow test whether it does.
Success can push a record out of its functional window
With the original writer, Eq. (3), valid records can remain below the functional window or grow beyond it. At and , half the reference gain (Supplementary Table S2), records formed but rarely came to rest inside the window: at the acquisition deadline most valid records lay below the sensing interval set by their competitors and several lay above it (Fig. 4d), and continuations from learned states lost sensing mostly through the upper end of the interval (Methods).
To test whether reinforcement causes this loss, we replayed four rewarded cycles from their saved states, keeping the random inputs fixed and changing only the strength of the common outcome pulse (Fig. 4e). The pulse writes all six links, so it changes the competing records as well as the valid one. In all four events, the full pulse carried a valid record already beyond both readout peaks farther from resonance. The competing records differed by at most 0.017 between the full-pulse and pulse-off replays (Supplementary Section S7.8). Together, these changes lowered the valid source's settled-field selection probability to 0.849–0.895. Removing the pulse kept the probability above 0.9. The valid record remained formed in every replay. Reinforcement can therefore increase the stored population while weakening its influence on source choice. These replays establish the causal role of the pulse in the selected events, but do not measure how often such failures occur because the events were chosen after inspection.
A self-limiting writer keeps learned records useful
The writer must drive a valid record across and then keep it within the range of useful readout. A mean-drift estimate using the measured admission statistics finds no constant gain that meets

b

c

d
Learning at w=0.6 misses the window from both sides (cycle 750)

valid record ; grey bar = sensing interval for the actual competitors
e
A correct outcome pushes the record out

Figure 4: A stored record need not be a functional record. a, Functional window for fixed records, with non-valid records in [0.50, 0.75]. The selection rule, Eq. (11), guarantees sensing for valid records between and for settled cavity fields (grey-blue band). Bounds from the reduced equations (Methods) require protection against two opposing unformed readers and valid revision within one reading. These conditions give the width range certified by the bounds (beige band, , valid records in [3.30, 3.60], box); the band marks what the bounds certify, not every functional configuration. The bar marks the range proved with the full reader equations at , with valid records in [3.30, 3.70]. b, From , the record of each active reader at and each source value -3: one reader at and two readers at keep the answer; two at reverse it at . c, At , two non-valid readers with records 0.75 and source values -3 leave an initially positive answer unchanged in sign. Against these readers, a valid reader with record 3.60 and source value +3 revises an answer starting at , the largest displacement the bounds cover, crossing zero at . Panels b,c use reference parameters (Methods), with readers starting at zero. d, Learning at (eight networks per trace rule, two needs each; Supplementary Section S7.7) at the acquisition deadline, cycle 750. For each need, the grey interval gives the valid-record values that ensure selection probability at least 0.9 against its two non-valid records; the symbol shows its valid record (orange, admission; green, use). e, Four rewarded cycles from the histories shown in d, each replayed from the same state and random inputs with the common six-link outcome pulse at full, half or zero strength. Filled symbols, settled-field selection probability for the end records; open symbols, live noisy sensing, tested at full and zero strength only. Labels give the trace rule (A, admission; U, use) and event cycle. The grey band, 0.8995–0.9005, marks the undecided sensing range (Methods); inset, half strength enlarged. Panel a is analytical. Panels b,c integrate the full reader and memory equations without noise; d,e show single realisations of the full network equations with noise. No error bars.
both requirements (Methods). We therefore shape the positive branch so that writing weakens as the record forms. The added factor depends only on the link’s population and receives no signal about validity or sensing:
where . The gains and control writing for positive and negative , respectively. The quantities , , and retain their definitions from Eq. (3). The absorption line has detuning and width . The capacity factor

b

e

C

d
Figure 5: Preserving readout does not ensure timely replacement. a, Counts among networks N1–N6, one per reassignment class, passing each criterion fixed before the runs: functional acquisition by cycle 750, operation to cycle 1250, the unchanged need, replacement by cycle 2000, operation after the change to cycle 2500 and no persistent false record. Right, networks passing all six. Rows show five writer laws: the self-limiting writer (absorption line + capacity ceiling), Eq. (4); the line alone; the capacity alone at ; the line's gains without its shape; and the original writer ( ). b, Summed excursion time above x = 3.60 during cycles 0–2499 in networks N1–N6, comparing the line alone with the self-limiting writer (logarithmic scale, time units). An excursion begins at an upward crossing of 3.60 and ends when the record falls below 3.59. c,d, Replacement in network N6 under the self-limiting writer. Panel c shows end-of-cycle records of the changed need's obsolete (orange) and new (blue) sources. Panel d shows their selection probabilities at that need's decisions (dots; lines, 9-decision moving averages). Triangles above d mark assisted readings of the new source followed by outcome writing. Vertical lines mark reassignment (cycle 1250), the obsolete record's first crossing below and the replacement deadline (cycle 2000). Supplementary Section S7.11 tabulates all six histories. e, Counts among 60 new networks, ten per reassignment, with random streams matched across writers (Methods). The writers are the self-limiting rule, its extension with the adverse-outcome susceptibility, and a uniformly stronger negative branch calibrated to the extension's added negative writing on the development histories. Right, completion of the whole sequence; counts and tests are given in the text. Full network equations with noise, run in the original simulation code (Methods) at , w = 0.6, with the admission trace. Panels a and e use criteria fixed before the runs; b–d were analysed after the runs. Panels c,d show single realisations. No error bars.
is one below , decreases linearly to zero at and vanishes above it. Setting and recovers the original writer because .
For , the absorption line follows from the cavity response to a separate write tone that fills the reservoir. The cavity is resonant with this tone at . Choosing this resonance below the formation barrier gives stronger absorption near the barrier than near the formed state . The factor and the control of write power by trace and outcome are retained from the original writer (Methods). The capacity remains phenomenological and would require a separate filling channel with finitely many states whose occupation follows the stored population.
We use , , , and . The negative branch therefore matches the original writer at . The capacity places a ceiling at , inside the functional window, that positive writing alone cannot carry a record across. The readout bounds thus provide a physical basis for deciding where reinforcement should stop.
We tested the rule in six networks, N1–N6, one for each reassignment, with no reset between learning, operation and adaptation (Supplementary Section S7.11). In all six, the writer acquired functional records by the deadline, operated reliably until reassignment and preserved the unchanged need, the first three of six criteria fixed before the runs (Fig. 5a). The population-dependent shaping is what makes the difference: the same gains without the absorption line or capacity acquired functional records in none of the six (Fisher's exact , tested after the runs), and the original writer in one (Methods).
The remaining criteria tested replacement after reassignment, operation after the change and absence of persistent false records. Compared with the absorption line alone, adding the capacity reduced the total duration of excursions above by a factor of about forty. It also eliminated excursions above 3.70, the upper edge of the proved reader window, in these six histories (Fig. 5b).
Replacement after reassignment proved harder. Two of the six networks completed the full sequence, passing the replacement tests by cycle 2000; these tests require functional readout through the new source and are stricter than the record crossings in Fig. 3d. The other four histories revealed the obstacle.
An obsolete record can block its own replacement
An obsolete record can continue to favour its source, restricting the readings that could establish a replacement. This persistent influence was clearest in N5 and N6, the two most severe replacement failures. From the obsolete record's first dip below until the replacement deadline, its source remained the most probable choice at every decision of the changed need. Over this interval, its mean selection probability was 0.88 in N5 and 0.92 in N6, compared with 0.065 and 0.04 for the new source. These measurements were made after the runs (Fig. 5c,d for N6; Supplementary Section S7.11).
Two effects sustained this preference. The sensing response changes continuously with population, so crossing below does not remove a record's advantage over a weaker competitor. The obsolete populations also recovered as passive filling and the bistable restoring flow outweighed negative net writing. Noise contributed to this recovery in N6 (Supplementary Section S7.11).
To test the obsolete record’s causal role, we restarted N5 and N6 at cycle 1626 and reset only that population to . All other initial states and random streams were matched to the unchanged continuation. The new source then had the stronger sensing signal at nearly every later decision of the changed need. Its record first crossed at cycle 1736 in N5 and 1717 in N6. Both networks passed the replacement test, while the unchanged need continued to pass its sensing tests (Supplementary Section S7.12). The reset therefore identifies the obsolete record as an obstacle to replacement. Because it changes both readouts, the intervention does not separate the effects of source selection and reader coupling.
A local response to adverse outcomes completes the learning sequence
To release an obsolete record through learning, the writer must respond to local activity and outcomes without a signal identifying which source has changed. We therefore add a signed, decaying state to each link, its adverse-outcome susceptibility. Adverse outcome signals raise this state and favourable signals lower it, with each update weighted by the link's eligibility trace. The state also relaxes towards zero. The aim is to strengthen negative writing on links whose recent activity repeatedly accompanies unsuccessful actions, as an obsolete source's does; whether the state accumulates on a link depends on its trace-weighted outcomes, not on error frequency alone. Only its positive part strengthens negative writing. Positive writing is unchanged, and the reservoir population continues to control both readouts (Methods).
In the six development networks, the susceptibility became positive on obsolete links after reassignment. It remained at or below zero on formed valid links during the tested operation periods, leaving their negative writing unchanged. One parameter was tuned using the saved histories of N5 and N6 (Supplementary Section S7.12).
We then tested the extension on 60 new networks, ten per reassignment, with random streams matched across writers and with the cohort, endpoint and tests fixed before the runs (Methods; Supplementary Section S7.13). Success required all six criteria of Fig. 5a to pass in the same history. The extension completed the sequence in 47 networks against 35 for the self-limiting writer (Fig. 5e): 13 networks succeeded only with the extension and one only without it, a paired improvement of 20 percentage points (two-sided exact paired test, Holm-adjusted ). The gains were largest where the obstacle lay, in replacement, operation after the change and absence of persistent false records. Local sensitivity to adverse outcomes therefore turns a writer that preserves readout into one that also completes the learning sequence under the tested conditions.
A uniformly stronger negative branch, calibrated to the extension’s added negative writing, served as a control and completed 41 networks. The extension’s advantage over it, seven discordant networks against one, did not reach significance (Holm-adjusted ), so how much of the benefit requires history dependence, beyond the added negative writing, remains open.
Implications for physical learning
Our model shows that action outcomes can train a material to favour informative sources and regulate their influence on memory: endogenous information control. The two functions, distinguished in psychological theories of attention [1, 2], share a physical basis here, two resonant readouts of one persistent reservoir population. Local updates allow the network to learn source relevance without supplied validity labels or target records.
This coupling makes readout physics part of the learning problem. Reinforcement can carry a record beyond resonance while leaving it formed. The resulting loss of function comes from weakened readout, which differs from synaptic saturation [33] or destruction of an attractor by training [34, 35]. Bounded plasticity is familiar [33, 36, 37]. Here, our sufficient bounds identify a common range for source selection, protection and revision.
The learned state also shapes the evidence available for further learning. An obsolete record can keep its source favoured and restrict readings of the source that should replace it. Replacement therefore requires access to new evidence as well as a change in the stored state. Local sensitivity to adverse outcomes offers one way to release obsolete preferences. History-dependent plasticity of this kind is already familiar in synapses and devices [16, 38–41]. How much of its benefit is specific to history dependence, rather than to the added negative writing, remains to be established.
Neither the mechanism nor its readout constraint is specific to optics. The constraint can arise whenever a persistent state shifts a resonance read at a fixed frequency, such as persistent flux in a superconducting resonator or stored stiffness in a mechanical one. The mechanism further requires local traces, outcome-dependent writing and a shared state controlling both readouts. Photonic precedents exist: silicon microrings hold bistable states through free-carrier and thermal shifts [42], and in a self-adapting microring network a phase-change state shifts a resonance, routes light and changes the illumination that drives its later switching [20].
A candidate polariton link would use two optical modes sharing one exciton reservoir. Separate experiments have demonstrated reservoir-induced resonance shifts [43], depletion of non-radiative exciton reservoirs in quantum wells [44] and electrically controlled exciton ionisation [45]. A first test needs no learning: prepare different reservoir populations and measure whether both readouts reproducibly follow the same state (Supplementary Section S8). Implementing the full network still requires a physical selection rule, outcome-gated writing and physical mechanisms for the trace, capacity limit and susceptibility. How learned function scales with network size and noise remains open.
Endogenous information control gives a material a stake in its own education: its experience shapes both its decisions and the evidence it encounters next, and keeping that control useful means writing each memory with its readout in mind and keeping obsolete preferences open to revision.
Methods
Field-reservoir element and network
Each link contains a driven cavity coupled to a slow reservoir. Absorbed light fills the reservoir, whose population shifts the cavity resonance and changes further absorption. The cavity amplitude a and population n obey
where and are the field and reservoir decay rates. The drive has amplitude and detuning above the bare resonance. The coefficients and set the resonance shift per excitation and the capture rate; is distinct from the score .
When , the field follows the slowly changing population and can be eliminated. With and , this gives Eq. (1). Supplementary Section S1.1 defines the normalised field b and power A. At the holding power, the reduced dynamics has an effective potential with two minima, corresponding to the low and high record states.
The network simulations retain both optical fields. For the link from source k to need j, is the cavity field, the reader field and the reservoir population. The answer memory is . In units of the memory response time,
The reader decays at rate and couples to the memory with strength , giving . This reader-memory coupling is reciprocal [46]; the source field , with , is prescribed. The parameter damps the imaginary part of the memory. Without reader or correction drives, Eq. (9) has stable states and is the normal form of a degenerate optical parametric oscillator above threshold [47].
The holding drive remains on throughout. The binary gate controls the probe of need 's links. The binary switch adds the selected source's weak cavity tone and couples its readers to both memories. Each weak tone has power . The tones are in phase with each other and in quadrature with the holding drive. At their largest combined drive power is 4.8, below the quasistatic switching threshold 5.089. The reader has no holding drive. Its ordinary detuning is . Assisted reading sets this detuning to zero only on the acting need's selected link.
The coefficient sets the reservoir filling by reader light. Outcome-dependent writing enters through . The other filling terms receive no outcome signal. At the reference parameters, the weak tones alone shift a record initially at by about 0.0067 during a ten-unit reading (Supplementary Section S3.1). After scoring, corrects the acting memory, where is that need's current hidden value. It does not write the relevance records.
Related resonance-shifting feedback occurs in polariton–exciton-reservoir [25, 48], free-carrier [49] and photothermal [50] cavities, although their microscopic mechanisms differ. Condensate–reservoir models admit different reductions depending on the relative relaxation rates [26]. A candidate polariton link could use long-lived excitons to shift both modes, with a phase-bistable condensate or parametric oscillator as the answer memory. The model requires one reservoir coordinate to tune both modes with the specified relative detunings, and it requires the direct polariton self-interaction shift to remain small relative to the cavity linewidth throughout holding, probing and writing, with its residual effect within the readout error budget, so that the field equation stays linear at fixed population (Supplementary Section S8). Reference values are , , and ; the reservoir outlives the cavity field by the factor , although records also form at , where the complete learning sequence has not been tested (Supplementary Section S7.5). Supplementary Section S8 sets out the implementation requirements and experimental tests.
Selection, parameters and decision cycle
During sensing, the acting need's cavity intensities give
where is distinct from the denominator in Eq. (1). Source k is selected with probability
The first term favours stronger relative responses, with setting the preference strength. The second provides uniform exploration. We use , and , giving a maximum selection probability of about 0.933, even with perfect sensing contrast. After selection, an independent draw provides assisted reading with probability 0.5. This allows a source to revise an answer before its record has formed.
Each run starts with and . The network evolves for 100 time units under the holding drive alone, with noise. The task then starts with newly drawn hidden values and . Supplementary Table S2 lists the reference parameters.
The needs alternate in 22-unit cycles (Fig. 1c). Each cycle contains two units of sensing, ten of reading and a two-unit delay before scoring. The acting need's probe stays on until scoring. Correction then acts for four units; after non-guess actions, the outcome pulse writes during the first two. Four quiet units complete the cycle.
With probability 0.2, the scored action is a designated fair guess. Its score updates the chance baseline, , with , and no outcome pulse follows. Otherwise, the action is the sign of , with a fair coin used when . This tie-break remains a non-guess action and triggers writing.
Hidden values flip with probability 0.1 at the end of each reading and each cycle. A copied valid reading therefore succeeds with probability 0.9. Retaining the corrected answer from the same need's previous action succeeds with probability 0.705, after four opportunities to flip. Supplementary Section S1.3 gives the full protocol and its redraw and co-reading variants.
Writer and traces
The factor , with , vanishes at zero and prevents the writer from driving the population negative. At , correct and incorrect answers give and . Chance-level success then gives a mean outcome factor of -0.2. Retaining the previous corrected answer gives only +0.005, because its success probability is 0.705. These averages describe the outcome signal; actual credit also depends on its association with the local trace (Eq. (18)).
All three traces retain recent activity with lifetime and suppress inputs below . Co-presence measures cavity light above the holding background, admission measures reader intensity, and use measures how strongly the reader pushes along the memory's motion:
Here , and and set the activity scales. Each simulation uses one rule, with parameters in Supplementary Table S2. The cutoff is distinct from the exploration fraction . The gate restricts the drive of admission and use traces to the acting need. It is off during the outcome pulse, so writing uses the trace left by the reading.
To interpret use, write . The intrinsic memory dynamics is a gradient flow in the effective potential . During reading, correction is off and the reader inputs supply the driving forces. Their exact work balance is
Each term on the left is a work rate in this effective potential, not a rate of physical energy transfer. Gating, thresholding and rectification make the resulting allocation of credit approximate. In the scalar examples of Supplementary Section S2, confirming readings leave less trace than reversals, and a weaker unrelated source read alongside the valid one receives little trace. This selectivity depends on the task: when hidden values are redrawn every cycle, use produces persistent false records on 17 of 48 co-read links (Supplementary Section S7.2).
When a need stops acting, its admission and use traces receive no new drive and decay exponentially. Their total remaining negative writing is finite, which bounds this contribution to record erosion (Supplementary Section S4.1).
Learned relevance, tests and statistics
The binary pattern marks formed records. The environmental assignment is described separately by , which is one when source is valid for need and zero otherwise. We say that the populations carry learned relevance when outcomes write them without access to and five criteria hold: (D1) origin: outcomes produce from the untrained state, whereas signal co-occurrence alone does not; (D2) sensing: a learned record increases its source's selection probability relative to an unformed record; (D3) evidence influence: for the same memory state and input, the learned record increases its source's effect on memory; (D4) separation: switching the acting need changes source preferences without changing , whereas reassignment changes only the affected entries of ; (D5) locality: the same local rule, applied to every link, works for every assignment tested. Source relabelling leaves the homogeneous equations unchanged, making assignments equivalent at fixed network size (Supplementary Section S4.2).
The historical test sets R1–R5 used criteria fixed before the runs. G1 checked their results by replay and rescoring (Supplementary Section S9.2). G2 compared the three trace rules on 24 new networks per rule, with matched random inputs. G3 extended these same histories to 3000 cycles and added interventions.
The sampling unit is a seeded network. Network proportions use exact binomial intervals; intervals for link rates resample whole networks. In the trace-rule studies, count comparisons used exact paired tests when random streams were matched and Fisher's exact test otherwise; the writer studies followed the comparison designs stated below. Median waiting times use Kaplan–Meier estimates, treating networks that do not cross the threshold during observation as censored. Reader-withdrawal effects use one-sided bootstrap intervals over paired networks. Transplant tests change only the populations under a common protocol for preparing the memories, traces and optical fields. Supplementary Sections S7.1–S7.4 give the criteria fixed before the runs, definitions of persistent false records and formation times, and intervention schedules.
Functional readout bounds
If the valid source’s sensing signal is at least times each competing signal, Eq. (11) gives a lower bound on its selection probability :
At the reference settings, , and , a contrast guarantees the target . For settled cavity fields and non-valid records in [0.50, 0.75], the bound gives the valid-record interval . These limits depend on the selection settings and target probability. Increasing to 10, with other settings unchanged, gives [1.976, 4.024]. Using the actual competitor records can give a wider interval.
Protection depends on the total gain of the active non-valid readers. In the reduced real-memory equation, let and let be the required distance from the decision boundary . Within the bounded state range specified in Supplementary Section S3.3, an answer starting with keeps its sign against sources with and summed gain at most if
where bounds the residual in the reduced equation, including reader transients and effects of the complex response . Its imaginary part vanishes at resonance and acts mainly on the strongly damped imaginary memory coordinate.
At , two readers at have a combined gain of 0.156, above the critical value 0.108, and can reverse a stored answer (Fig. 4b). The bounds therefore require protection against up to two simultaneous non-valid readers. This covers the non-acting memory in the co-reading test; the standard protocol presents each memory with at most one non-valid source at a time. Revision requires a valid reader to overcome the memory's restoring force and the allowed opposing readers within one reading. Under the state bounds in Supplementary Section S3.3, protection and revision share the sufficient width range for valid records in [3.30, 3.60] and non-valid records in [0.50, 0.75], assuming the residual bound ; the full-reader analysis below removes this assumption at . Both conditions concern unassisted readings. Assisted readings continue during operation and are outside the protection guarantee.
At w = 0.6, the full reader and memory analysis includes the switch-on transient and establishes all three functions for fixed valid records in [3.30, 3.70], with non-valid records in [0.50, 0.75] and the specified reset states. It also covers records that stay within 0.01 of reference values, with valid references in [3.30, 3.60], including noisy paths, provided the initial reader and memory states and the competing records satisfy the stated bounds (Supplementary Sections S3.3 and S3.4). The argument assigns no probability to the records remaining within these limits, and sensing additionally requires a bound on cavity-field errors, including direct field noise. These are sufficient conditions for specified record configurations and reading preparations; they do not guarantee readout from arbitrary dynamical states.
Finite pulses and the learning target
The credit delivered by a finite pulse depends on the trace throughout that pulse. For , the coordinate removes the factor from the original writer. The writer's contribution to the change in is exactly , where is the trace area over the pulse and is constant during it. Passive flow and noise contribute separately. For fixed and ,
Credit therefore depends on success weighted by local activity. The overall fraction of successful actions does not determine it. Even at equal populations, two links can receive different credit from the same outcome pulse because their traces differ (Supplementary Section S5.2).
The learning target is the probability that, from the acquisition deadline through operation, the records remain in the functional window and every allowed readout test succeeds from the evolving state (Supplementary Section S5.3). The simulations check acquisition by a deadline and the readings sampled during operation; they do not certify continuous survival. With the original writer at w = 0.6 and , all tested continuations from learned states lost sensing within 151 cycles, mostly through the upper boundary of the sensing interval (Supplementary Section S7.9).
Matched outcome-pulse intervention
The pulse-replay test (FRCP1) asks whether a rewarded pulse can cause a loss of sensing. We replayed four positive pulses that preceded such a loss in the learning histories behind Fig. 4d (FPL1). Each replay starts from the complete saved network state with the original random streams. Only the writer term on all six links changes: it is multiplied by , giving a full, half or absent pulse.
The full-pulse replay reproduces the original event, and all three versions agree before the pulse. Differences afterwards can therefore be attributed to the changed writing. The events were selected after inspection; the multipliers and thresholds for classifying sensing were fixed before replay. The test establishes causation in these selected events without estimating how often the mechanism occurs. Supplementary Section S7.8 gives the event identifiers, settled-field and live sensing measurements, and the band in which sensing is classified as unresolved.
Construction of the self-limiting writer
The self-limiting writer, Eq. (4), weakens positive writing through two factors set by the link's population. The first, the absorption line , follows from the cavity response to a write tone of power and detuning . This tone drives the same mode as the holding drive. At fixed , the fields add linearly and beat at frequency . If the write envelope and reservoir vary slowly over a beat period, the mean filling intensity after cavity relaxation is
Controlling the write power through the local trace and positive outcome signal gives filling proportional to , with . This control and the factor remain proposed device operations inherited from the original writer. Representative formation pulses require a write power of order ten times the holding power during the two-unit pulse. A device must supply this power without saturating the cavity or shared reservoir (Supplementary Section S6).
The capacity factor is one below , decreases linearly to zero at and remains zero above it. Positive writing alone cannot bring a record to from below in a finite pulse. At , the settled cavity supplies slightly less filling than reservoir decay removes, even with both weak tones on. Additional filling from reader absorption and field transients must remain within this margin for deterministic confinement. Noise can still carry records above the ceiling: maxima in the six-network validation reached 3.63–3.66, above . The capacity factor is phenomenological and would require a separate filling channel whose occupation follows rapidly. Saturating the shared reservoir would also alter the holding dynamics and bistability (Supplementary Section S6).
We chose the writer parameters using an approximate mean-flow calculation that combines passive restoration with outcome-dependent writing. Event rates, trace areas and outcome statistics were measured under the original writer in the development study described below. The calculation seeks positive drift across the formation barrier, a stable high-record equilibrium below the upper sensing limit , and negative drift for an obsolete record receiving chance-level outcomes. Under the measured admission statistics, formation requires , whereas confinement below requires
. Keeping the equilibrium below the upper edge of the proved reader window requires . No constant gain meets both formation and confinement conditions in this approximation. Under use statistics, the conditions overlap narrowly. At , the admission calculation predicts slightly negative drift through part of the formation interval, consistent with formation aided by fluctuations in the admission networks of Fig. 4d; the use calculation lies close to its threshold and depends on how trace areas are conditioned on the outcome. Event statistics can change with the writer, so the calculation serves as a design guide whose predictions are tested by the controls below (Supplementary Section S6 and Supplementary Fig. S3).
Development study
The development study (FML1) used a separate implementation of Eqs. (6)–(14) at . Each combination of writer law and trace rule used eight networks at , with random streams matched across writer laws, on the schedule of the six-network validation below; every cycle was checked for sensing and for the protection and revision tests applicable to its unassisted readings. The study compared controls that separated the gain change from the absorption line, the capacity and the choice of writing branch. Under admission, a uniformly stronger writer and the self-limiting gains without either population factor formed records but left no network functional at the acquisition deadline, and shaping both branches erased no obsolete record, which supports shaping only positive writing. At this implementation formed records faster than the original code; at the sampled formation-time distributions were consistent between codes, although agreement between individual trajectories has not been established. We therefore report it as a development study and do not pool its results with the validation (Supplementary Section S7.10).
Six-network validation
We ran networks N1–N6 (study S3VAL) in the original code at and , using the admission trace. Each network represented one of the six combinations of changed need and new valid source. Runs followed four stages without reset: acquisition to cycle 750, operation until reassignment at 1250, adaptation to 2000 and further operation to 2500. We compared the five writer laws in Fig. 5a. The line with capacity and the line alone shared random streams.
Six criteria were fixed before the runs: functional acquisition; operation before reassignment; preservation of the unchanged need; replacement by cycle 2000; operation after that deadline; and absence of persistent false records. Functional acquisition required formed records with successful sensing, protection and revision. Replacement required sensing and revision through the new source, together with protection against every tested pattern of non-valid readings containing the obsolete source. Supplementary Section S7.11 defines the pass and fail thresholds and the undecided bands between them. Two separately written scorers agreed on all 180 criterion labels.
The comparisons fixed before the runs concerned completion of the whole sequence. The acquisition comparison of six successes against none was added afterwards. It used Fisher's exact test because the self-limiting writer and the control with the same gains but neither population factor did not share random streams. Selection probabilities, counts of new-source readings and excursion times were also analysed after the runs. Supplementary Section S7.11 reports these analyses.
Adverse-outcome susceptibility and sixty-network comparison
Each link has a signed susceptibility , initialised to zero at preparation. During feedback, it accumulates with weight +1 for and for . It also relaxes towards zero with lifetime . The negative gain in Eq. (4) becomes , while positive writing is unchanged. The extension requires no additional external signal and reduces to the self-limiting writer wherever (Supplementary Section S7.12).
We used , and . The gain was selected using the saved histories of N5 and N6 during the development study (RLR1), and was chosen with knowledge of the reassignment schedule. All three parameters were fixed before the first simulation with the extension and were not changed afterwards.
The sixty-network comparison (VAL1) tested the self-limiting writer, its susceptibility extension and a uniform control on 60 new networks, ten per reassignment. All started from the unformed preparation in the original code at and followed the schedule above. Random streams were matched across writers within each network. The uniform control retained the positive branch and multiplied the negative gain by approximately 1.228, giving . This multiplier was calibrated before the comparison by evaluating the extension along the six saved self-limiting-writer histories. Summed over all links and histories, its added negative writing in was 0.228 times the baseline negative writing. This calibration matches writing on the saved paths; the new trajectories can receive different totals.
The cohort, endpoint, two primary comparisons, tests and decision rule were fixed before the runs. The endpoint required all six criteria to pass in the same history. Two-sided exact McNemar tests, which compare the extension with each control using only the networks that passed under one writer and failed under the other, were the primary tests. A Holm adjustment, which multiplies the smaller of the two P-values by two, controlled the familywise error rate at 0.05 across the two comparisons. Superiority required statistical significance and a positive paired difference. Numerically unresolved histories counted as failures. The comparison between the uniform control and the self-limiting writer was secondary. Two separately written scorers agreed on all 1,080 criterion labels. The failed development expectation that initial formation times would remain within of those under the self-limiting writer was retained as a secondary diagnostic (Supplementary Section S7.13).
Noise and numerical resolution
We integrate the deterministic dynamics with fourth-order Runge–Kutta steps. After each step, independent Gaussian increments are added to each record and to the real and imaginary parts of each cavity field. Negative populations are set to zero. Readers, memories, traces and susceptibility states receive no direct noise (Supplementary Sections S1.5 and S7.12).
The trace-rule comparison and its extension (G2, G3) use , with matched-noise checks at 0.001 and, where needed, 0.0005. All aggregate test verdicts were unchanged across the tested steps, although individual counts and some quantities measured over short trajectory segments depended on the step size (Supplementary Section S9).
The six-network and sixty-network writer studies use . A separate check (RES1) repeated the six development networks N1–N6 under the three VAL1 writers at , with noise increments coupled between resolutions. All 18 complete-sequence outcomes and 108 criterion labels were unchanged. This tests sensitivity to one halving of the step; it does not establish a convergence order (Supplementary Section S9.1).
Data availability
The source data for the figures, the numerical histories and the scored criterion labels (Supplementary Information, Section S9.3) will be made available in a public repository at publication. Until then they are available from the author on reasonable request.
Code availability
The simulation, analysis and scoring code (Supplementary Information, Section S9.3) will be made available in the same repository at publication. Until then it is available from the author on reasonable request.
Acknowledgements
N.G.B. acknowledges support from the HORIZON EIC-2022-PATHFINDERCHALLENGES-01 HEISINGBERG Project 101114978, the EPSRC UK Multidisciplinary Centre for Neuromorphic Computing (grant UKRI982) and the Weizmann–UK Make Connection Grant 142568. The author thanks Anthropic for access to Claude, a large language model. Claude was used to edit the manuscript and the Supplementary Information, and Claude Code was used to help write and run the simulation and analysis code. The author checked all code, results and text and takes full responsibility for the content.
Author contributions
N.G.B. conceived the study, developed the model and its analysis, designed and carried out the numerical simulations, analysed the results and wrote the manuscript.
Competing interests
The author declares no competing interests.
Additional information
Supplementary information is available at https://www.damtp.cam.ac.uk/user/ngb23/publications/endogenous_si.pdf. Correspondence and requests for materials should be addressed to N.G.B.
References
[1] Mackintosh, N. J. A theory of attention: variations in the associability of stimuli with reinforcement. Psychol. Rev. 82, 276–298 (1975).
[2] Pearce, J. M. & Hall, G. A model for Pavlovian learning: variations in the effectiveness of conditioned but not of unconditioned stimuli. Psychol. Rev. 87, 532–552 (1980).
[3] Gottlieb, J., Oudeyer, P.-Y., Lopes, M. & Baranes, A. Information-seeking, curiosity, and attention: computational and neural mechanisms. Trends Cogn. Sci. 17, 585–593 (2013).
[4] Kaspar, C., Ravoo, B. J., van der Wiel, W. G., Wegner, S. V. & Pernice, W. H. P. The rise of intelligent matter. Nature 594, 345–355 (2021).
[5] Keim, N. C., Paulsen, J. D., Zeravcic, Z., Sastry, S. & Nagel, S. R. Memory formation in matter. Rev. Mod. Phys. 91, 035002 (2019).
[6] Bhattacharyya, K., Zwicker, D. & Alim, K. Memory formation in adaptive networks. Phys. Rev. Lett. 129, 028101 (2022).
[7] Stern, M., Hexner, D., Rocks, J. W. & Liu, A. J. Supervised learning in physical networks: from machine learning to learning machines. Phys. Rev. X 11, 021045 (2021).
[8] Stern, M. & Murugan, A. Learning without neurons in physical systems. Annu. Rev. Condens. Matter Phys. 14, 417–441 (2023).
[9] Dillavou, S., Stern, M., Liu, A. J. & Durian, D. J. Demonstration of decentralized physics-driven learning. Phys. Rev. Applied 18, 014040 (2022).
[10] Scellier, B. & Bengio, Y. Equilibrium propagation: bridging the gap between energy-based models and backpropagation. Front. Comput. Neurosci. 11, 24 (2017).
[11] López-Pastor, V. & Marquardt, F. Self-learning machines based on Hamiltonian echo backpropagation. Phys. Rev. X 13, 031020 (2023).
[12] Wright, L. G. et al. Deep physical neural networks trained with backpropagation. Nature 601, 549–555 (2022).
[13] Momeni, A., Rahmani, B., Malléjac, M., del Hougne, P. & Fleury, R. Backpropagation-free training of deep physical neural networks. Science 382, 1297–1303 (2023).
[14] Ibrahim, M. Sequential learning and catastrophic forgetting in differentiable resistor networks. Phys. Rev. E 113, 065303 (2026).
[15] Du, Y., van Mastrigt, R., Veenstra, J. & Coulais, C. Metamaterials that learn to change shape. Nat. Phys. 22, 784–790 (2026).
[16] Loeffler, A. et al. Neuromorphic learning, working memory, and metaplasticity in nanowire networks. Sci. Adv. 9, eadg3289 (2023).
[17] Dillavou, S. & Mishra, S. Physical reinforcement learning. Preprint at https://arxiv.org/abs/2511.17789 (2025).
[18] Dillavou, S. et al. Machine learning without a processor: emergent learning in a nonlinear analog network. Proc. Natl Acad. Sci. USA 121, e2319718121 (2024).
[19] Feldmann, J., Youngblood, N., Wright, C. D., Bhaskaran, H. & Pernice, W. H. P. All-optical spiking neurosynaptic networks with self-learning capabilities. Nature 569, 208–214 (2019).
[20] Lugnan, A. et al. Emergent self-adaptation in an integrated photonic neural network for backpropagation-free learning. Adv. Sci. 12, 2404920 (2025).
[21] Opala, A., Ghosh, S., Liew, T. C. H. & Matuszewski, M. Neuromorphic computing in Ginzburg–Landau polariton-lattice systems. Phys. Rev. Applied 11, 064029 (2019).
[22] Ballarini, D. et al. Polaritonic neuromorphic computing outperforms linear classifiers. Nano Lett. 20, 3506–3512 (2020).
[23] Kanno, K., Naruse, M. & Uchida, A. Adaptive model selection in photonic reservoir computing by reinforcement learning. Sci. Rep. 10, 10062 (2020).
[24] Kanno, K. & Uchida, A. Photonic reinforcement learning based on optoelectronic reservoir computing. Sci. Rep. 12, 3720 (2022).
[25] Stepanov, P. et al. Dispersion relation of the collective excitations in a resonantly driven polariton fluid. Nat. Commun. 10, 3869 (2019).
[26] Kalinin, K. P. & Berloff, N. G. Polaritonic network as a paradigm for dynamics of coupled oscillators. Phys. Rev. B 100, 245306 (2019).
[27] Baas, A., Karr, J. Ph., Eleuch, H. & Giacobino, E. Optical bistability in semiconductor microcavities. Phys. Rev. A 69, 023809 (2004).
[28] Yagishita, S. et al. A critical time window for dopamine actions on the structural plasticity of dendritic spines. Science 345, 1616–1620 (2014).
[29] Brzosko, Z., Schultz, W. & Paulsen, O. Retroactive modulation of spike timing-dependent plasticity by dopamine. eLife 4, e09685 (2015).
[30] Izhikevich, E. M. Solving the distal reward problem through linkage of STDP and dopamine signaling. Cereb. Cortex 17, 2443–2452 (2007).
[31] Gerstner, W., Lehmann, M., Liakoni, V., Corneil, D. & Brea, J. Eligibility traces and plasticity on behavioral time scales: experimental support of neoHebbian three-factor learning rules. Front. Neural Circuits 12, 53 (2018).
[32] Demirağ, Y. et al. PCM-trace: scalable synaptic eligibility traces with resistivity drift of phase-change materials. In 2021 IEEE International Symposium on Circuits and Systems (ISCAS), 1–5 (2021).
[33] Fusi, S. & Abbott, L. F. Limits on the memory storage capacity of bounded synapses. Nat. Neurosci. 10, 485–493 (2007).
[34] Essex, A. E., Janson, N. B., Norris, R. A. & Balanov, A. G. Memorization and forgetting in a learning Hopfield neural network: bifurcation mechanisms, attractors, and basins. Chaos 36, 083138 (2026).
[35] Eisenmann, L., Monfared, Z., Göring, N. & Durstewitz, D. Bifurcations and loss jumps in RNN training. In Adv. Neural Inf. Process. Syst., vol. 36, 70511–70547 (2023).
[36] Grossberg, S. How does a brain build a cognitive code? Psychol. Rev. 87, 1–51 (1980).
[37] Fusi, S., Drew, P. J. & Abbott, L. F. Cascade models of synaptically stored memories. Neuron 45, 599–611 (2005).
[38] Bienenstock, E. L., Cooper, L. N. & Munro, P. W. Theory for the development of neuron selectivity: orientation specificity and binocular interaction in visual cortex. J. Neurosci. 2, 32–48 (1982).
[39] van Rossum, M. C. W., Bi, G. Q. & Turrigiano, G. G. Stable Hebbian learning from spike timing-dependent plasticity. J. Neurosci. 20, 8812–8821 (2000).
[40] Prezioso, M., Merrikh Bayat, F., Hoskins, B., Likharev, K. & Strukov, D. Self-adaptive spike-time-dependent plasticity of metal-oxide memristors. Sci. Rep. 6, 21331 (2016).
[41] Rahman, M., Bose, S. & Chakrabartty, S. On-device synaptic memory consolidation using Fowler–Nordheim quantum-tunneling. Front. Neurosci. 16, 1050585 (2023).
[42] Foradori, A. et al. Memory in integrated photonic neural networks: from physical mechanisms to neuromorphic architectures. Preprint at https://arxiv.org/abs/2604.22620 (2026).
[43] Schmidt, D. et al. Tracking dark excitons with exciton polaritons in semiconductor microcavities. Phys. Rev. Lett. 122, 047403 (2019).
[44] Kurdyubov, A. S. et al. Optical control of a dark exciton reservoir. Phys. Rev. B 104, 035414 (2021).
[45] Suchomel, H. et al. Prototype of a bistable polariton field-effect transistor switch. Sci. Rep. 7, 5114 (2017).
[46] Takata, K., Marandi, A. & Yamamoto, Y. Quantum correlation in degenerate optical parametric oscillators with mutual injections. Phys. Rev. A 92, 043821 (2015).
[47] Wang, Z., Marandi, A., Wen, K., Byer, R. L. & Yamamoto, Y. Coherent Ising machine based on degenerate optical parametric oscillators. Phys. Rev. A 88, 063853 (2013).
[48] Wouters, M. & Carusotto, I. Excitations in a nonequilibrium Bose–Einstein condensate of exciton polaritons. Phys. Rev. Lett. 99, 140402 (2007).
[49] Hamerly, R. & Mabuchi, H. Quantum noise of free-carrier dispersion in semiconductor optical cavities. Phys. Rev. A 92, 023819 (2015).
[50] Konthasinghe, K. et al. Self-sustained photothermal oscillations in high-finesse Fabry–Perot microcavities. Phys. Rev. A 95, 013826 (2017).