interplane.Get Omega
Read in your language

aien-train

AIEN training programme: language-model history, GB10 constraints and the route to training on the project engine. Plans and runnable checks are distinguished.

Brought by drakestapleton

branch main Branches Tags History

aien-train / native / neuralese / learn.om

328 lines · 4037 bytes Raw Blame History
1note SPDX-License-Identifier: AGPL-3.0-only
2note Freeze NL1-20261028-1: no heldout tuning, early stopping, or adaptive schedule.
3text REC "R,"
4text PAR "P,"
5text TIME "T,"
6text FIN "NL1LEARN END\n"
7global LS ulong 6
8global DC uchar 1
9
10fn lend to void
11z = write 1 EOL 0 1
12if ne z 1
13exit 80
14end
15end
16
17fn ltag tag ulong to void
18if eq tag 0
19z = write 1 REC 0 2
20if ne z 2
21exit 80
22end
23end
24if eq tag 1
25z = write 1 PAR 0 2
26if ne z 2
27exit 80
28end
29end
30if eq tag 2
31z = write 1 TIME 0 2
32if ne z 2
33exit 80
34end
35end
36for i ulong 3
37nnum get LS i
38nsep
39end
40end
41
42fn ldecode n ulong ctx bool to int
43if ne n 3
44ret 1
45end
46for k ulong 3
47if not le fabs get LH k 1.0f64
48ret 2
49end
50end
51lrecv ctx
52ret 0
53end
54
55fn lpert mode ulong to void
56if or or eq mode 1 eq mode 2 and ge mode 13 le mode 15
57q = 16.0f64
58if eq mode 2
59q = 32.0f64
60end
61if eq mode 13
62q = 1.0f64
63end
64if eq mode 14
65q = 2.0f64
66end
67if eq mode 15
68q = 4.0f64
69end
70for k ulong 3
71v = get LH k
72m = div f64 long add mul fabs v q 0.5f64 q
73if lt v 0.0f64
74m = neg m
75end
76put LH k m
77end
78end
79if eq mode 3
80for k ulong 3
81put LH k neg get LH k
82end
83end
84if eq mode 4
85v = get LH 0
86put LH 0 get LH 1
87put LH 1 v
88end
89if and ge mode 5 le mode 12
90for k ulong 3
91v = 0.03125f64
92if eq and shr sub mode 5 k 1 0
93v = neg v
94end
95put LH k add get LH k v
96end
97end
98if ge mode 16
99put LH 2 0.0f64
100end
101if eq mode 17
102put LH 1 0.0f64
103end
104end
105
106fn lemit id ulong mode ulong ctx bool enc ulong dec ulong rc int to void
107ltag 0
108nnum id
109nsep
110nnum mode
111nsep
112flag = ulong 0
113if ctx
114flag = 1
115end
116nnum flag
117nsep
118for k ulong 3
119nnum bitcast ulong get LH k
120nsep
121end
122for j ulong 4
123nnum bitcast ulong get LO j
124nsep
125end
126abst = ulong 0
127for j ulong 4
128p = ulong 0
129if ge get LO j 0.5f64
130p = 1
131end
132if ne rc 0
133p = 9
134end
135nnum p
136nsep
137if lt fabs sub get LO j 0.5f64 0.1f64
138abst = 1
139end
140end
141if ne rc 0
142abst = 1
143end
144nnum abst
145nsep
146nnum enc
147nsep
148nnum dec
149nsep
150nnum ulong rc
151lend
152end
153
154fn lctrls to int
155for j ulong 4
156put LO j -77.0f64
157end
158rc = ldecode 2 true
159if ne rc 1
160ret 41
161end
162put LH 0 div 0.0f64 0.0f64
163rc = ldecode 3 true
164if ne rc 2
165ret 42
166end
167put LH 0 div 1.0f64 0.0f64
168rc = ldecode 3 true
169if ne rc 2
170ret 43
171end
172put LH 0 2.0f64
173rc = ldecode 3 true
174if ne rc 2
175ret 44
176end
177for j ulong 4
178if ne get LO j -77.0f64
179ret 45
180end
181end
182linit 17
183v = get LP 0
184put LG 0 div 0.0f64 0.0f64
185rc = lstep 0.1f64 0
186if or ne rc 2 ne get LP 0 v
187ret 46
188end
189rc = lstep -0.1f64 0
190if ne rc 1
191ret 47
192end
193ret 0
194end
195
196fn denc id ulong mode ulong to void
197v = id
198if eq mode 16
199v = and v 7
200end
201if eq mode 17
202v = and v 3
203end
204put DC 0 uchar v
205for k ulong 3
206put LH k 0.0f64
207end
208put LH 0 f64 get DC 0
209end
210
211fn drecv to void
212for j ulong 4
213v = and shr ulong get DC 0 j 1
214put LO j f64 v
215end
216end
217
218fn dctrl to int
219note Keep sender input fixed at 15, then mutate only the transmitted byte.
220denc 15 0
221drecv
222for j ulong 4
223if ne get LO j 1.0f64
224ret 76
225end
226end
227put DC 0 uchar 0
228drecv
229for j ulong 4
230if ne get LO j 0.0f64
231ret 77
232end
233end
234ret 0
235end
236
237fn lcase arm ulong id ulong mode ulong ctx bool to void
238start = monons
239linput id id
240if eq arm 3
241note Actual one-byte carrier; receiver has no input-ID argument.
242denc id mode
243else
244lsend arm
245lpert mode
246end
247enc = sub monons start
248start = monons
249rc = int 0
250if eq arm 3
251drecv
252else
253rc = ldecode 3 ctx
254end
255dec = sub monons start
256lemit id mode ctx ulong enc ulong dec rc
257end
258
259fn lmodel seed ulong split ulong arm ulong to int
260put LS 0 seed
261put LS 1 split
262put LS 2 arm
263linit seed
264start = monons
265if ne arm 3
266rc = ltrain arm split
267if ne rc 0
268ret 50
269end
270end
271elapsed = sub monons start
272ltag 2
273nnum ulong elapsed
274lend
275if ne arm 3
276for p ulong 31
277ltag 1
278nnum p
279nsep
280nnum bitcast ulong get LP p
281lend
282end
283end
284for id ulong 16
285for mode ulong 18
286if and eq arm 3 and ne mode 0 lt mode 16
287continue
288end
289for cx ulong 2
290lcase arm id mode eq cx 0
291end
292end
293end
294ret 0
295end
296
297fn main to int
298rc = dctrl
299if ne rc 0
300ret rc
301end
302rc = lctrls
303if ne rc 0
304ret rc
305end
306for seedid ulong 3
307seed = ulong 17
308if eq seedid 1
309seed = 29
310end
311if eq seedid 2
312seed = 43
313end
314for split ulong 2
315for arm ulong 5
316rc = lmodel seed split arm
317if ne rc 0
318ret rc
319end
320end
321end
322end
323z = write 1 FIN 0 len FIN
324if ne z long len FIN
325ret 80
326end
327ret 0
328end