Views
No views yet
"Entity" is a person.) rather than the conventional BIO tag list. At the 1.3 B base scale, generative NER is only reliable when the training format stays close to the model's native text distribution; structured-tag targets push the autoregressive decoder into out-of-distribution prefixes that fail to generate under greedy decoding.repetition_penalty >= 1.1 and no_repeat_ngram_size >= 3, the model extracts 2-4 entities per short sentence in the "Entity" is a [category]. pattern.lm_head_stage into the effective lm_head_base when chaining, so this stage composes with the other sibling specialists (chat, math, code, tool, summary) via logits = lm_head_base(x) + Sigma_k lm_head_stage_k(x).1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4model_id = "cognica/Cognica-PoE-v1.0-1.3B-stage-ner"
5tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
6model = AutoModelForCausalLM.from_pretrained(
7 model_id,
8 trust_remote_code=True,
9 torch_dtype=torch.bfloat16,
10 device_map="auto",
11)
12model.eval()
13
14BOS, USR_S, USR_E, ASS_S = 32759, 32760, 32761, 32762
15text = "Barack Obama was born in Hawaii and served as the 44th President of the United States."
16prompt = f"{text}\n\nList the entities."
17ids = [BOS, USR_S] + tokenizer.encode(prompt) + [USR_E, ASS_S]
18input_ids = torch.tensor([ids], device=model.device)
19
20with torch.no_grad():
21 out = model.generate(
22 input_ids,
23 max_new_tokens=80,
24 do_sample=True,
25 temperature=0.3,
26 top_k=50,
27 repetition_penalty=1.3,
28 no_repeat_ngram_size=3,
29 pad_token_id=BOS,
30 )
31print(tokenizer.decode(out[0, len(ids):]))
32# '"Hawaii" is a location. "United States" is a location. ...'repetition_penalty=1.3 and no_repeat_ngram_size=3 are both required. Without them, the decoder loops on a single entity.max_new_tokens modest (40-80). The first few entities are the reliable ones; later tokens drift.temperature in [0.2, 0.5].| Component | Detail |
|---|---|
| Parent | cognica/Cognica-PoE-v1.0-1.3B-base (PoE alpha=0.0, d24, step 26430, val bpb 0.7209) |
| New transformer layers | 4 appended at positions 24-27 (d24 -> d28) |
| Frozen layers | 24 (all base layers) |
| Dual-head | Yes — additive specialist lm_head_stage (shape 32768 x 1536, zero-init at training start) |
| Final projection | logits = lm_head_base(x) + lm_head_stage(x) |
| Total params | 1,547,699,986 (~1.55 B) |
| Trainable params at training | 163,577,912 (~164 M, 10.6 %) |
| Shipped delta | 28 tensors, 213,909,560 params, 408 MB (bf16 safetensors) |
| VE pattern | Preserved from base — 12 value-embeds at layers [1, 3, ..., 23]; new layers carry no VE |
| Objective | Cross-entropy over assistant turns only (uniform weighting, no label smoothing) |
| Target format | Natural-language sentences: "Entity" is a [PERSON|ORGANIZATION|LOCATION|MISC category]. |
| User prompt | {text}\n\nList the entities. |
| Tag schema | PERSON, ORGANIZATION, LOCATION, MISC (coarse 4-class, collapsed from source datasets) |
| Data | tomaarsen/conll2003 x 20 epochs + DFKI-SLT/few-nerd supervised x 5 epochs + Babelscape/wikineural train_en x 6 epochs -> 1,495,463 train convs (+ 512 held-out val) |
| Case augmentation | -> 1,505,623 conversations |
| Sequence length | 2,048 |
| Per-GPU batch | 8 x 2,048 |
| World size | 4 (1 node x 4 x A100 80 GB) |
| Total batch size | 65,536 tokens/step |
| Steps | 1,329 |
| Optimizer | MuonAdamW with per-group LR scaling |
| Matrix LR | 3.0 x 10^-4 |
lm_head_stage LR | 1.0 x 10^-4, weight decay 0.1 |
| Init LR fraction | 0.2 |
| Warmup / warmdown | 5 % / 50 % |
| Eval / save cadence | every 25 / 100 steps |
| Shipped checkpoint | step 1,329, val bpb 1.9722 (best-and-final) |
| Step | val bpb |
|---|---|
| 25 | 4.6791 |
| 100 | 4.3801 |
| 250 | 3.8106 |
| 500 | 3.1899 |
| 750 | 2.7118 |
| 1000 | 2.1835 |
| 1200 | 2.0034 |
| 1325 | 1.9722 |
base_model_name_or_path supports chaining. Point a new stage repo's config at this repo and the cascade loader will resolve base -> stage-ner -> new stage transparently. The loader folds each ancestor's lm_head_stage into the effective lm_head_base at load time, so all specialist heads compose additively into the final projection (logits = lm_head_base + Sigma_k lm_head_stage_k). See the paper for the formal account of this construction.| File | Purpose |
|---|---|
config.json | Model + stage config |
delta.safetensors | 28-tensor stage delta (bf16, 408 MB) |
modeling_cognica_poe.py | Cascade loader + _GPT with dual-head forward |
configuration_cognica_poe.py | CognicaPoEConfig with stage fields |
tokenization_cognica_poe.py | Byte-level tokenizer |
tokenizer.pkl, tokenizer_config.json, special_tokens_map.json, token_bytes.pt | Tokenizer assets |
convert_stage_delta.py | Converts a nanochat save_stage_delta .pt into delta.safetensors |
"Entity" is a category. sentences, not token-labeled spans. Not a drop-in replacement for encoder-based NER (e.g. spaCy, CoNLL-trained BERT).repetition_penalty>=1.1 and no_repeat_ngram_size>=3 are mandatory.max_new_tokens <= 80.train_val_bpb = 0.7209.1@article{jeong2026poe,
2 title = {Product of Experts as Scalable Local Learning: Modular Construction at 1.3B Parameters},
3 author = {Jeong, Jaepil},
4 year = {2026},
5 institution = {Cognica, Inc.},
6 doi = {10.5281/zenodo.19547653},
7 url = {https://doi.org/10.5281/zenodo.19547653}
8}
9
10@misc{cognica-poe-stage-ner-2026,
11 title = {Cognica-PoE-v1.0-1.3B-stage-ner: NER dual-head specialist (4-layer) over a PoE base (research preview)},
12 author = {{Cognica, Inc.}},
13 year = {2026},
14 howpublished = {\url{https://huggingface.co/cognica/Cognica-PoE-v1.0-1.3B-stage-ner}}
15}LICENSE and NOTICE. Same terms as the base model. Training datasets (CoNLL-2003, FewNERD, WikiNeural) each carry their own licenses and are acknowledged in NOTICE.