KitsuVp commited on
Commit
4e30450
·
verified ·
1 Parent(s): c6314fa

Update configuration_neollm.py

Browse files
Files changed (1) hide show
  1. configuration_neollm.py +21 -8
configuration_neollm.py CHANGED
@@ -156,10 +156,12 @@ class NeoLLMConfig(PretrainedConfig):
156
  General dropout probability for attention outputs and MLP states.
157
  use_embedding_input_norm (:obj:`bool`, *optional*, defaults to ``True``):
158
  Controls only the first pre-attention normalisation applied to the
159
- raw embedding stream. When ``True``, layer 0 applies ``SeeDNorm``
160
- before its attention block, preserving the previous behaviour. When
161
- ``False``, layer 0 receives the raw token embeddings directly while
162
- all deeper decoder layers keep their normal pre-norm flow unchanged.
 
 
163
  use_token_generator (:obj:`bool`, *optional*, defaults to ``False``):
164
  Replace the discrete vocabulary embedding lookup table with a
165
  **Leviathan** continuous token generator (Batley & Saha, 2026).
@@ -206,6 +208,14 @@ class NeoLLMConfig(PretrainedConfig):
206
  values, such as ``32``, are valid memory-saving variants but are
207
  not the full paper-faithful default. Ignored when
208
  ``use_token_generator=False``.
 
 
 
 
 
 
 
 
209
  use_jtokm (:obj:`bool`, *optional*, defaults to ``False``):
210
  Enable the **Leviathan-JTok-M** token-indexed modulation module
211
  (Yang et al., 2026; fused with Leviathan geometry).
@@ -607,13 +617,14 @@ class NeoLLMConfig(PretrainedConfig):
607
  # ── Embedding input normalization ─────────────────────────────────
608
  use_embedding_input_norm=False,
609
  # ── Leviathan continuous token generator ──────────────────────────
610
- use_token_generator=True,
611
  generator_d_seed=128,
612
  generator_num_modes=8,
613
  generator_num_knots=32,
614
  generator_spline_degree=2,
615
  generator_k=3,
616
- generator_krank=32,
 
617
  # ── Leviathan-JTok-M token-indexed modulation ─────────────────────
618
  use_jtokm=False,
619
  jtokm_num_experts=4,
@@ -856,8 +867,9 @@ class NeoLLMConfig(PretrainedConfig):
856
  # ── Embedding input normalization ─────────────────────────────────
857
  # True preserves the previous layer-0 pre-norm path:
858
  # embeddings -> SeeDNorm -> LNS -> attention.
859
- # False bypasses only that first SeeDNorm so raw embeddings enter the
860
- # first attention block; layers >= 1 keep their pre-norm unchanged.
 
861
  self.use_embedding_input_norm = use_embedding_input_norm
862
 
863
  # ── Leviathan generator ───────────────────────────────────────────
@@ -868,6 +880,7 @@ class NeoLLMConfig(PretrainedConfig):
868
  self.generator_spline_degree = generator_spline_degree
869
  self.generator_k = generator_k
870
  self.generator_krank = generator_krank
 
871
 
872
  # ── Leviathan-JTok-M ─────────────────────────────────────────────
873
  self.use_jtokm = use_jtokm
 
156
  General dropout probability for attention outputs and MLP states.
157
  use_embedding_input_norm (:obj:`bool`, *optional*, defaults to ``True``):
158
  Controls only the first pre-attention normalisation applied to the
159
+ raw embedding stream. When ``True``, layer 0 instantiates and applies
160
+ ``SeeDNorm`` before its attention block, preserving the previous
161
+ behaviour. When ``False``, layer 0 does not instantiate that
162
+ ``SeeDNorm`` module, so its parameters are actually removed and raw
163
+ token embeddings enter the first attention block directly. All deeper
164
+ decoder layers keep their normal pre-norm flow unchanged.
165
  use_token_generator (:obj:`bool`, *optional*, defaults to ``False``):
166
  Replace the discrete vocabulary embedding lookup table with a
167
  **Leviathan** continuous token generator (Batley & Saha, 2026).
 
208
  values, such as ``32``, are valid memory-saving variants but are
209
  not the full paper-faithful default. Ignored when
210
  ``use_token_generator=False``.
211
+ generator_khronos_chunk_size (:obj:`int`, *optional*, defaults to 16):
212
+ Number of seed dimensions evaluated at once inside the Leviathan
213
+ KHRONOS tensor product. This does not change the mathematical
214
+ function: it computes the same product by accumulating
215
+ ``Σ_d log|phi_d|`` over chunks. The default ``16`` avoids
216
+ materializing the full ``[N, d_seed, krank]`` tensor during
217
+ torch.compile/AOTAutograd while preserving the article's separable
218
+ product.
219
  use_jtokm (:obj:`bool`, *optional*, defaults to ``False``):
220
  Enable the **Leviathan-JTok-M** token-indexed modulation module
221
  (Yang et al., 2026; fused with Leviathan geometry).
 
617
  # ── Embedding input normalization ─────────────────────────────────
618
  use_embedding_input_norm=False,
619
  # ── Leviathan continuous token generator ──────────────────────────
620
+ use_token_generator=False,
621
  generator_d_seed=128,
622
  generator_num_modes=8,
623
  generator_num_knots=32,
624
  generator_spline_degree=2,
625
  generator_k=3,
626
+ generator_krank=64,
627
+ generator_khronos_chunk_size=16,
628
  # ── Leviathan-JTok-M token-indexed modulation ─────────────────────
629
  use_jtokm=False,
630
  jtokm_num_experts=4,
 
867
  # ── Embedding input normalization ─────────────────────────────────
868
  # True preserves the previous layer-0 pre-norm path:
869
  # embeddings -> SeeDNorm -> LNS -> attention.
870
+ # False removes that first SeeDNorm module entirely, so raw embeddings
871
+ # enter the first attention block and the layer-0 input-norm parameters
872
+ # are not counted; layers >= 1 keep their pre-norm unchanged.
873
  self.use_embedding_input_norm = use_embedding_input_norm
874
 
875
  # ── Leviathan generator ───────────────────────────────────────────
 
880
  self.generator_spline_degree = generator_spline_degree
881
  self.generator_k = generator_k
882
  self.generator_krank = generator_krank
883
+ self.generator_khronos_chunk_size = generator_khronos_chunk_size
884
 
885
  # ── Leviathan-JTok-M ─────────────────────────────────────────────
886
  self.use_jtokm = use_jtokm