Text Generation
Transformers
Safetensors
English
ouro
custom-code
storytelling
small-language-model
recurrent-depth
synthetic-data
custom_code
Instructions to use raincandy-u/MacroStories with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use raincandy-u/MacroStories with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="raincandy-u/MacroStories", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("raincandy-u/MacroStories", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use raincandy-u/MacroStories with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "raincandy-u/MacroStories" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "raincandy-u/MacroStories", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/raincandy-u/MacroStories
- SGLang
How to use raincandy-u/MacroStories with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "raincandy-u/MacroStories" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "raincandy-u/MacroStories", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "raincandy-u/MacroStories" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "raincandy-u/MacroStories", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use raincandy-u/MacroStories with Docker Model Runner:
docker model run hf.co/raincandy-u/MacroStories
Update README.md
Browse files
README.md
CHANGED
|
@@ -16,13 +16,11 @@ tags:
|
|
| 16 |
|
| 17 |
## How small can an autoregressive Transformer be and still write a complete story?
|
| 18 |
|
| 19 |
-
MacroStories is a **19,969-parameter autoregressive Transformer** that generates complete English children's stories from a single start token.
|
| 20 |
|
| 21 |
-
[TinyStories](https://arxiv.org/abs/2305.07759) showed that small Transformers can write coherent English when trained on a suitable distribution of synthetic stories.
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
What did we do? We gave Codex a goal and provided guidance when needed. Codex running GPT-6.1-Sol, assisted by GPT-6-Luna subagents, autonomously carried out the entire training workflow—from generating data with a local Gemma model to training, evaluation, and final model selection. It completed **38 experimental rounds on a single RTX 3090**, choosing each next experiment based on earlier results.
|
| 26 |
|
| 27 |
## Quick start
|
| 28 |
|
|
@@ -101,9 +99,9 @@ MacroStories was trained from random initialization using an implementation adap
|
|
| 101 |
|
| 102 |
## Training
|
| 103 |
|
| 104 |
-
|
| 105 |
|
| 106 |
-
Stories were generated with a local Gemma model served through vLLM, using vocabulary constraints and numbered character markers.
|
| 107 |
|
| 108 |
Training used next-token cross-entropy on the fourth recurrent pass. Muon updated the decoder's two-dimensional linear weight matrices; AdamW updated the remaining parameters.
|
| 109 |
|
|
@@ -118,7 +116,6 @@ Training used next-token cross-entropy on the fourth recurrent pass. Muon update
|
|
| 118 |
|
| 119 |
## Evaluation
|
| 120 |
|
| 121 |
-
|
| 122 |
| Criterion | Stories meeting the criterion |
|
| 123 |
|---|---:|
|
| 124 |
| Goal resolved through relevant actions and an outcome | 98 / 100 |
|
|
@@ -129,13 +126,11 @@ Training used next-token cross-entropy on the fourth recurrent pass. Muon update
|
|
| 129 |
|
| 130 |
## Example output
|
| 131 |
|
| 132 |
-
Sample 20 from the evaluation set contains **106 words** and meets all four criteria:
|
| 133 |
-
|
| 134 |
> "I want to help this flower," Alex said. The flower was dry in the village garden. Alex wanted to water the flower. Alex grabbed a large bucket, but the bucket was too heavy for them to lift. Alex looked at the small cup on the bench. Alex dipped the cup into the bucket. Alex walked to the flower and poured the water onto the soil. Alex went back and forth. Alex made several trips with the small cup. Alex poured more water into the dirt. Alex and Robin watched the plant. Finally, the flower got enough water. Alex smiled because the flower was not dry now.
|
| 135 |
|
| 136 |
## Capabilities
|
| 137 |
|
| 138 |
-
|
| 139 |
|
| 140 |
## Acknowledgments
|
| 141 |
|
|
|
|
| 16 |
|
| 17 |
## How small can an autoregressive Transformer be and still write a complete story?
|
| 18 |
|
| 19 |
+
MacroStories is a **19,969-parameter autoregressive Transformer** that generates complete English children's stories from a single start token. Her FP32 weights occupy just **81,364 bytes—smaller than many PNG images**.
|
| 20 |
|
| 21 |
+
[TinyStories](https://arxiv.org/abs/2305.07759) showed that small Transformers can write coherent English when trained on a suitable distribution of synthetic stories.
|
| 22 |
|
| 23 |
+
We takes this question down to about **20 thousand parameters**, roughly one fiftieth of a one-million-parameter model and proved that a model even this small can write a story of 100–300 words that establishes a goal, takes relevant actions, and reaches an outcome that resolves it.
|
|
|
|
|
|
|
| 24 |
|
| 25 |
## Quick start
|
| 26 |
|
|
|
|
| 99 |
|
| 100 |
## Training
|
| 101 |
|
| 102 |
+
We gave Codex a goal and guidance when needed. She autonomously carried out the entire workflow, generating data, forming hypotheses, testing them, refining them from the results, and testing again—through **38 experimental rounds** to final model selection.
|
| 103 |
|
| 104 |
+
Stories were generated with a local Gemma model served through vLLM, using vocabulary constraints and numbered character markers. Codex reviewed complete stories for grammatical correctness, goal resolution, and character and object consistency.
|
| 105 |
|
| 106 |
Training used next-token cross-entropy on the fourth recurrent pass. Muon updated the decoder's two-dimensional linear weight matrices; AdamW updated the remaining parameters.
|
| 107 |
|
|
|
|
| 116 |
|
| 117 |
## Evaluation
|
| 118 |
|
|
|
|
| 119 |
| Criterion | Stories meeting the criterion |
|
| 120 |
|---|---:|
|
| 121 |
| Goal resolved through relevant actions and an outcome | 98 / 100 |
|
|
|
|
| 126 |
|
| 127 |
## Example output
|
| 128 |
|
|
|
|
|
|
|
| 129 |
> "I want to help this flower," Alex said. The flower was dry in the village garden. Alex wanted to water the flower. Alex grabbed a large bucket, but the bucket was too heavy for them to lift. Alex looked at the small cup on the bench. Alex dipped the cup into the bucket. Alex walked to the flower and poured the water onto the soil. Alex went back and forth. Alex made several trips with the small cup. Alex poured more water into the dirt. Alex and Robin watched the plant. Finally, the flower got enough water. Alex smiled because the flower was not dry now.
|
| 130 |
|
| 131 |
## Capabilities
|
| 132 |
|
| 133 |
+
The model is designed only to generate English children's stories. She has **no world knowledge or instruction-following capability**. She does not support factual question answering, conversation, or writing on arbitrary topics.
|
| 134 |
|
| 135 |
## Acknowledgments
|
| 136 |
|