CoolFace
Modelpublic

MuratcanKoylan/Marketing-Memory-Routing-8B

sourceHugging Faceapache-2.0updated 10mo agoView on Hugging Face
1likes
MODEL_CARD.md129 linesDownload Raw Back to root
1# Model Card: Memory Routing Agent (Llama-8B + LoRA)2 3## Model Details4 5- **Model Name**: memory-routing-llama-8b-lora6- **Base Model**: meta-llama/Llama-3.1-8B7- **Architecture**: LoRA (Low-Rank Adaptation), rank 328- **Training Platform**: Tinker (Thinking Machines)9- **Training Method**: SFT (Supervised Fine-Tuning) + RL (Reinforcement Learning)10- **Parameters**: ~8B base + ~100M LoRA adapters11- **License**: Apache 2.012 13## Intended Use14 15This model classifies marketing conversations into memory categories for AI assistant systems. It determines which pieces of information from a conversation should be stored in long-term memory and how they should be categorized.16 17### Primary Use Cases18- Marketing AI assistants that need to remember user preferences19- CRM systems that extract structured data from conversations20- Knowledge management systems for marketing teams21 22### Out-of-Scope Uses23- General-purpose chatbots24- Non-marketing domains (healthcare, legal, finance)25- Real-time conversation generation26 27## Training Data28 29### Synthetic Dataset30- **Size**: 2,001 conversations31- **Generation**: Cohere Command-R-Plus (104B) as teacher model32- **Format**: Multi-turn marketing conversations with category labels33 34### Category Taxonomy (13 categories)35| Category | Description | Persistence |36|----------|-------------|-------------|37| company.brand_core | Voice, values, positioning | Long (>1y) |38| company.strategic_signatures | Decision frameworks | Long (>1y) |39| company.knowledge_artifacts | Docs, style guides | Long (>1y) |40| company.business_priorities | Quarterly goals | Short (<3m) |41| company.tools_config | Integrations, APIs | Medium (~6m) |42| company.performance_context | Campaign metrics | Rolling (~6m) |43| user.communication_style | Tone, format preferences | Long (>1y) |44| user.strategic_approach | Personal priorities | Long (>1y) |45| user.role_context | Title, scope | Medium (~1y) |46| user.workflow_patterns | Review cadence | Medium (~1y) |47| user.session_history | Immediate context | Short (<2w) |48| user.interaction_preferences | Coaching style | Evolving |49| none | Irrelevant content | N/A |50 51## Training Procedure52 53### Phase 1: Supervised Fine-Tuning (SFT)54- **Steps**: 10055- **Batch Size**: 12856- **Learning Rate**: 2.86e-4 (Tinker default for Llama-8B)57- **Optimizer**: Adam (β1=0.9, β2=0.95)58- **Loss Function**: Cross-entropy59 60### Phase 2: Reinforcement Learning (RL)61- **Iterations**: 1262- **Groups per Batch**: 6463- **Group Size**: 3264- **Learning Rate**: 2e-565- **Loss Function**: Importance sampling policy gradient66- **Reward Function**: 67  - R_F1 (60%): F1 score vs gold labels68  - R_temp (20%): Temporal alignment69  - R_parity (10%): Company/user scope70  - R_eff (10%): Storage efficiency71 72## Evaluation Results73 74### Marketing Routing Benchmark (50 scenarios)75 76| Model | Any Match | Exact Match | Avg F1 |77|-------|-----------|-------------|--------|78| **Ours (8B + LoRA)** | 72% | **60%** | **0.68** |79| Cohere Command-R-Plus (104B) | 82% | 26% | 0.61 |80 81### Key Findings82- **11.1% higher F1** than the 104B teacher model83- **2.3x better exact match** accuracy84- **13x smaller** than the teacher model85- Excels at single-category classification (86% exact on easy cases)86- Struggles with multi-label scenarios (10% exact on hard cases)87 88### Performance by Difficulty89| Difficulty | Our Model (F1) | Cohere (F1) | Delta |90|------------|----------------|-------------|-------|91| Easy | 0.86 | 0.48 | +79% |92| Medium | 0.65 | 0.64 | +2% |93| Hard | 0.50 | 0.72 | -31% |94 95## Limitations96 971. **Multi-label Detection**: Under-predicts when multiple categories apply982. **Company vs User Confusion**: Sometimes confuses `company.strategic_signatures` with `user.strategic_approach`993. **Hard Cases**: Performance drops on complex overlapping categories1004. **Domain Specificity**: Trained only on marketing scenarios101 102## Ethical Considerations103 104- Model trained on synthetic data; may not capture all real-world edge cases105- Should be used with human oversight for critical decisions106- Privacy: Does not store or transmit conversation data107 108## Citation109 110```bibtex111@misc{memory-routing-agent-2025,112  title={Memory Routing Agent: Prompt Distillation for Marketing AI},113  author={Muratcan Koylan},114  year={2025},115  howpublished={\url{https://github.com/muratcankoylan/memory-routing-agent}},116}117```118 119## Model Files120 121- `training/checkpoints/rl_iter_012/` - Final RL checkpoint122- `training/benchmarks/marketing_routing_benchmark.json` - Benchmark dataset123- `synthetic_data/merged_training_dataset_2001.jsonl` - Training data124 125## Contact126 127For questions or issues, please open a GitHub issue.128 129