File size: 4,999 Bytes
cb274bd
 
 
 
ba109da
a4e7910
ba109da
a4e7910
5ce4a34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a4e7910
ba109da
a4e7910
ba109da
a4e7910
ba109da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5ce4a34
 
 
ba109da
 
 
 
 
 
 
5ce4a34
 
ba109da
5ce4a34
 
 
ba109da
 
 
 
 
 
5ce4a34
 
 
 
 
 
 
 
ba109da
 
 
 
f1bf9cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
---
tags:
- ml-intern
---
# 🧠 NeuroLex v4 β€” Creative Name Diffusion Engine

> A domain-specific AI architecture that generates truly creative, novel names for brands, YouTube channels, social media handles, and more β€” using **Uniform Discrete Language Diffusion** instead of autoregressive LLMs.

## πŸš€ Quick Start (Colab)

```python
# Clone and setup
!git clone https://huggingface.co/krystv/neurolex-v4-creative-name-diffusion
%cd neurolex-v4-creative-name-diffusion
!python setup.py  # ← IMPORTANT: fixes imports

# Train (~25 minutes on free T4)
!python train.py --size base --epochs 30 --batch_size 256

# Generate names
from neurolex_v4_model import *
checkpoint = torch.load('./checkpoints/neurolex_v4_best.pt')
config = NeuroLexConfig(**checkpoint['config'])
model = NeuroLexV4(config).cuda()
model.load_state_dict(checkpoint['state_dict'])
model.eval()

names = model.generate(
    domain_id=DOMAIN_TO_ID['tech'],
    style_id=STYLE_TO_ID['sharp'],
    lang_id=LANG_TO_ID['english'],
    target_length=8, batch_size=20,
    cfg_scale=2.5, temperature=0.9,
    n_steps=80, odd_alpha=8.0, device='cuda'
)
print(names)
```

## 🎯 The Problem We Solve

**Why do LLMs and current AI name generators suck at creative naming?**

| Problem | Root Cause | Example |
|---------|-----------|---------|
| **Repetition** | AR probability feedback loops | Generates "Nexaflow" 50 times |
| **Generic outputs** | MLE training β†’ common patterns | "TechFlow", "DataStream", "CloudSync" |
| **Mode collapse** | Small model memorizes modes | Only 47% uniqueness (v3) |
| **Can't invent words** | Subword tokenizers recombine known pieces | Just concatenation of morphemes |
| **Sounds cringe** | No phonotactic awareness | "Xyzptlk", "Blorpify" |
| **No cultural sense** | Ignores language-specific sound patterns | Same output for Japanese vs French vibe |

## ✨ Our Solution: Discrete Diffusion (NOT Autoregressive)

```
LLM/GPT approach (BROKEN):
  [Start] β†’ P(next|left) β†’ P(next|left) β†’ ... β†’ same output every time

NeuroLex v4 (WORKS):
  [Random Noise] ← denoise ← denoise ← ... ← [Novel Name]
  (different noise each time = different output each time)
```

### Key Innovations

| Innovation | What It Does | Based On |
|-----------|-------------|----------|
| **UDLM** | Uniform noise β†’ iterative denoising | MDLM (NeurIPS 2024) |
| **Classifier-Free Guidance** | Control generation without mode collapse | Discrete CFG (2024) |
| **ODD** | Batch samples actively repel each other | ODD (2025) |
| **adaLN** | Condition modulates every layer | DiT (2023) |
| **Cosine schedule** | More refinement time at low noise | DDPM/MDLM |
| **Character vocab** | Generate truly novel sequences | ByT5 principles |

## πŸ“Š Specifications

| Property | Value |
|----------|-------|
| Parameters | ~12M (base) |
| Vocabulary | 72 characters (a-z, A-Z, 0-9, specials) |
| Max name length | 24 characters |
| Languages | 25 |
| Domains | 20 |
| Styles | 10 |
| Training time | ~25 min on free Colab T4 |
| GPU memory | <8 GB |
| Target diversity | 90%+ uniqueness |

## πŸ“ Repository Structure

```
β”œβ”€β”€ neurolex_v4_model.py       # Core UDLM architecture (DiT + CFG + ODD)
β”œβ”€β”€ neurolex_v4_dataset.py     # Built-in dataset (25 languages, 20 domains)
β”œβ”€β”€ train.py                   # Training script (CLI)
β”œβ”€β”€ generate.py                # Interactive generation script
β”œβ”€β”€ test_model.py              # Validation tests
β”œβ”€β”€ setup.py                   # Run first to fix imports
β”œβ”€β”€ NeuroLex_v4_Training.ipynb # Complete Colab notebook
└── README.md                  # This file
```

## πŸ”¬ Research Foundation

1. **MDLM** β€” NeurIPS 2024 ([arxiv:2406.07524](https://arxiv.org/abs/2406.07524))
2. **Discrete CFG** β€” ([arxiv:2412.10193](https://arxiv.org/abs/2412.10193))
3. **ODD** β€” ([arxiv:2603.04893](https://arxiv.org/abs/2603.04893))
4. **DiT** β€” Peebles & Xie, 2023
5. **GFlowNet** β€” NeurIPS 2021 ([arxiv:2106.04399](https://arxiv.org/abs/2106.04399))
6. **Sound Symbolism** β€” ([arxiv:2310.16781](https://arxiv.org/abs/2310.16781))
7. **ByT5** β€” ([arxiv:2105.13626](https://arxiv.org/abs/2105.13626))
8. **SimCTG** β€” NeurIPS 2022 ([arxiv:2202.06417](https://arxiv.org/abs/2202.06417))

## πŸ“ License

Apache 2.0

<!-- ml-intern-provenance -->
## Generated by ML Intern

This model repository was generated by [ML Intern](https://github.com/huggingface/ml-intern), an agent for machine learning research and development on the Hugging Face Hub.

- Try ML Intern: https://smolagents-ml-intern.hf.space
- Source code: https://github.com/huggingface/ml-intern

## Usage

```python
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "krystv/neurolex-v4-creative-name-diffusion"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
```

For non-causal architectures, replace `AutoModelForCausalLM` with the appropriate `AutoModel` class.