---
license: other
language: en
library_name: transformers
tags:
- transformer
- language-models
- long-context
- memory-augmented-transformers
- eidosformer
- causal-language-modeling
- ai-research
- neural-architecture
- episodic-memory
- semantic-memory
- kNN-inference
- compressive-transformer
- llama-family
- PyTorch
model-index:
- name: EidosFormer 1B
config:
model_type: eidosformer
num_hidden_layers: 24
hidden_size: 2048
num_attention_heads: 16
intermediate_size: 5632
memory_store: FAISS
max_position_embeddings: 8192
results: []
widget:
- text: "The EidosFormer model represents a significant advancement in"
---
# EidosFormer โ Memory-Native Transformer Architecture
**A novel transformer architecture that unifies episodic, semantic, and working memory systems for long-context understanding.**
[๐ค Hugging Face](https://huggingface.co/Himan-de/EidosFormer) โข [๐ Model Card](https://huggingface.co/Himan-de/EidosFormer)
---
## ๐ Overview
**EidosFormer** (pronounced *eye-dos-former*) is a memory-augmented language model that integrates four independently validated research mechanisms into a unified, end-to-end trainable architecture. It addresses the long-context problem by maintaining **three parallel memory subsystems**:
| Memory System | Capacity | Update Rule | Retrieval Mechanism |
|---|---|---|---|
| **Episodic** | Dynamic (FAISS-backed) | STE kNN append | Cosine similarity retrieval |
| **Semantic** | Fixed centroid slots | Soft-gated EMA consolidation | Attention-based recall |
| **Working** | Window-size bounded | Standard transformer attention | Direct positional access |
### Key Innovations
1. **Differentiable Consolidation**: Episodic memories automatically compress into semantic representations using dual objectives (reconstruction loss + attention-preservation loss)
2. **Ebbinghaus-Style Recall Reinforcement**: Frequently retrieved items receive memory boost, preventing catastrophic forgetting in long sequences
3. **Multi-Cross-Attention Gating**: First-layer cross-attention connects all memory streams; subsequent layers operate on unified representations
4. **Modern Architecture Stack**: Grouped Query Attention (GQA), RoPE with NTK/Instruct scaling, RMSNorm, SwiGLU feedforward โ proven Llama-family components
## ๐๏ธ Architecture
```
Input Tokens
โ
โโโบ Token Embedding + Temporal Encoding (wall-clock aware)
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโ
โ Episodic Memory Store โ โ FAISS ANN index, STE kNN retrieval
โโโโโโโโโโโโโโโโโโโโโโโโโ
โ retrieved_kv
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโ
โ Semantic Patterns โ โ EMA-updated centroids (consolidated from episodic)
โโโโโโโโโโโโโโโโโโโโโโโโโ
โ merged with kv
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโ
โ Memory Cross-Attn โ โ Layer 0: connects all memory streams
โโโโโโโโโโโโโโโโโโโโโโโโโ
โ unified representation
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ EidosBlock ร N layers โ โ CausalSelfAttention + SwiGLU blocks
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโ
โ MemoryWriteHead โ โ gated write-back to episodic store
โโโโโโโโโโโโโโโโโโโโโโโโโ
Side channels (trainer-driven, no-grad):
- model.append_episodic(x) โ FAISS vector store
- model.write_to_semantic() โ soft-gated EMA update
- model.apply_consolidation() โ weakest-slot compression
- model.resize_semantic(n) โ memory curriculum (grow/shrink)
```
## ๐ Quick Start
### Installation
```bash
pip install transformers torch faiss-cpu accelerate sentencepiece
```
### Loading the Model
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"Himan-de/EidosFormer",
trust_remote_code=True,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(
"Himan-de/EidosFormer",
trust_remote_code=True
)
# Generate text
inputs = tokenizer("The future of AI is driven by memory systems that enable:", return_tensors="pt")
outputs = model.generate(**inputs.to(model.device), max_new_tokens=256, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```
### Using with the Hugging Face Hub
```bash
# Access via huggingface-cli
huggingface-cli login # Enter your token when prompted
huggingface-cli download Himan-de/EidosFormer --local-dir ./eidosformer
```
## ๐ Model Specifications
| Parameter | Value |
|---|---|
| **Parameters** | ~1 Billion (1B) |
| **Architecture** | Custom Transformer with Memory Modules |
| **Hidden Size** | 2048 |
| **Layers** | 24 EidosBlocks |
| **Attention Heads** | 16 (Grouped Query Attention) |
| **Intermediate FFN** | 5632 (SwiGLU) |
| **Position Encoding** | RoPE with NTK/Instruct Scaling + Temporal Tokens |
| **Max Context Length** | 8192 tokens |
| **Embedding Dim** | 2048 (tied to LM head) |
| **Memory Stores** | Episodic (FAISS) + Semantic (EMA centroids) |
## ๐งช Training Details
- **Framework**: PyTorch with custom memory backends
- **Optimizer**: AdamW with cosine annealing and warmup
- **Checkpoint Steps**: Trained from step 1000 through ~98,000 steps
- **Final Checkpoint**: `1b_final.pt` (recommended for inference)
- **Intermediate Checkpoints**: Available (`1b_ckpt_*pt`) for reproducibility
## ๐ฌ Research Foundations
EidosFormer synthesizes mechanisms from:
1. **[Memorizing Transformers](https://arxiv.org/abs/2003.07862)** (Wu et al., 2022) โ differentiable memory with kNN retrieval
2. **[Compressive Transformers](https://arxiv.org/abs/1907.01014)** (Rae et al., 2019) โ multi-resolution episodic-to-semantic consolidation
3. **[MemoryBank](https://arxiv.org/abs/2306.xxxx)** (Zhong et al., 2023) โ recency-and-frequency-based recall dynamics
## ๐ Citation
If you use EidosFormer in your research:
```bibtex
@misc{eidosformer2026,
title={EidosFormer: Memory-Native Transformers with Multi-Store Consolidation},
author={Dixit, Himanshu},
year={2026},
publisher={Hugging Face},
url={https://huggingface.co/Himan-de/EidosFormer}
}
```
## ๐ License
**Proprietary โ Contact Author for Commercial Use**
This model is released under a custom license. For commercial usage, licensing inquiries, or collaboration opportunities, please reach out via the discussions tab on Hugging Face.
For academic research use, please request access through the gated repo link above.
## โ ๏ธ Known Limitations
- Episodic memory retrieval quality depends on FAISS index construction (flat L2 for best accuracy, HNSW for speed)
- Semantic consolidation is gradient-free during inference; quality depends on training-time consolidation ratio
- Memory store capacity grows with sequence length; consider pruning strategies for production deployments
## ๐ Acknowledgments
- Built upon the excellent Transformers library by Hugging Face
- FAISS vector search library (Meta AI) for efficient kNN retrieval
- Inspired by: Wu et al. (Memorizing Transformers), Rae et al. (Compressive Transformers), Zhong et al. (MemoryBank)
## ๐ฌ Contact
For questions, collaboration, or licensing inquiries:
- Open a [Discussion](https://huggingface.co/Himan-de/EidosFormer/discussions)
- Visit the [GitHub repo](https://github.com/himan/eidosformer)
---
Memory is the foundation of intelligence.
โ EidosFormer Research Team, 2026