--- 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