File size: 1,887 Bytes
099b7ee
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
language: en
license: mit
tags:
- diffusion
- text-generation
- riddles
- diffusion-lm
datasets:
- prajwaldongre/riddles-a-synthetic-riddle-dataset-for-nlp
metrics:
- exact-match
- token-f1
---

# Diffusion-LM Riddle Solver — Phase 3 Reconstructed

A Diffusion-LM-style (Li et al., 2022) text generation model trained on 232 synthetic riddles. Held-out exact match: **47.0%** (K=1 and K=10).

## Model description

Continuous embedding diffusion with a Transformer encoder/decoder. The model takes a riddle as context and iteratively denoises Gaussian noise into answer word embeddings via a learned reverse process.

## Intended use

Research and diagnostics. Not a production-ready riddle solver.

## Training data

[Riddles — A Synthetic Riddle Dataset for NLP](https://www.kaggle.com/datasets/prajwaldongre/riddles-a-synthetic-riddle-dataset-for-nlp) (CC0). 232 training examples after deduplication.

## Architecture

| Parameter | Value |
|-----------|-------|
| Parameters | 8,024,576 |
| Timesteps (T) | 200 |
| d_model | 256 |
| Layers | 4 |
| d_ff | 1024 |
| Heads | 4 |
| Answer length | 4 |
| Noise schedule | sqrt power-law |

## Performance

| Split | Exact match (K=1) | Token F1 |
|-------|-------------------|----------|
| Train (n=192) | 87.5% | 0.960 |
| Held-out (n=66) | 47.0% | 0.523 |

## Limitations

- Trained on 232 examples only. Does not generalize broadly.
- Uses continuous embedding diffusion with Euclidean clamping. Discrete formulations may differ.
- Exact-match metric penalizes semantically equivalent answers.

## Files

- `model.safetensors`: Model weights
- `config.json`: Architecture hyperparameters
- `vocab.json`: Vocabulary mapping
- `inference.py`: Standalone prediction script

## Source

Full source code, diagnostics, and reproduction configs: [github.com/beme08/riddle-diffusion-lm](https://github.com/beme08/riddle-diffusion-lm)