explaingit

jdeschena/s-flm

Analysis updated 2026-05-18

10PythonAudience · researcherComplexity · 5/5Setup · hard

TLDR

A research codebase for S-FLM, a language model that generates text by rotating points on a mathematical sphere instead of predicting words one at a time.

Mindmap

mindmap
  root((S-FLM))
    What it does
      Generates text via flow matching
      Rotates points on a sphere
      Improves math reasoning accuracy
    Tech stack
      Python
      PyTorch
      HuggingFace checkpoints
    Use cases
      Reproduce paper results
      Compare model architectures
      Train on math or Sudoku data
    Audience
      ML researchers
      Language model builders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Reproduce the S-FLM paper's results on TinyGSM math reasoning or OpenWebText language modeling.

USE CASE 2

Download pretrained S-FLM, AR, MDLM, Duo, FLM, or CANDI checkpoints to compare model behavior.

USE CASE 3

Train a spherical flow-matching language model on a custom Sudoku puzzle dataset.

USE CASE 4

Evaluate generative perplexity and GSM8K accuracy across several competing model architectures.

What is it built with?

PythonPyTorchHuggingFaceCUDA

How does it compare?

jdeschena/s-flmalsgur9865-sketch/second-brain-enginecompumaxx/gba-video-studio
Stars101010
LanguagePythonPythonPython
Setup difficultyhardmoderatehard
Complexity5/53/54/5
Audienceresearcherdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires multi-GPU training infrastructure and matched CUDA versions, ideally via the recommended NGC PyTorch container.

No license information is stated in the README.

In plain English

S-FLM is a research codebase for a new kind of AI language model, the type of system that generates text, solves math problems, or completes code. Most language models predict one word at a time, moving left to right. S-FLM explores a different approach: it uses a process called flow matching to gradually transform random noise into finished text. The key idea is that words and sentences can be represented as points on a mathematical sphere. The model learns to rotate random starting points toward the correct text, rather than picking words one at a time. This spherical approach gives the S in S-FLM. The authors state that earlier flow based models matched standard left to right language models at producing plausible sounding text, but fell short on tasks where getting the exact answer right matters, such as math problems. S-FLM shows improvement on the GSM8K math reasoning benchmark compared to those earlier flow based approaches. The repository contains the training and evaluation code from the accompanying research paper, along with pretrained checkpoints that can be downloaded from HuggingFace. It supports training on two main datasets: TinyGSM, a math reasoning dataset, and OpenWebText, a general language modeling dataset. A synthetic Sudoku puzzle task with adjustable difficulty is also included for controlled experiments. Training scripts cover several competing model types for comparison, including standard autoregressive models and other diffusion or flow based approaches named MDLM, Duo, FLM, and CANDI, which makes it possible to reproduce the paper's side by side comparisons. Setup requires a Python 3.12 environment with specific torch and numpy versions, and the authors recommend using an NVIDIA container image to keep CUDA versions aligned. The project is written in Python.

Copy-paste prompts

Prompt 1
Help me set up the conda environment and install the correct torch and numpy versions for s-flm.
Prompt 2
Explain the difference between S-FLM's spherical flow matching approach and standard autoregressive language models.
Prompt 3
Download the tinygsm/duo.ckpt checkpoint from the jdeschena/s-flm HuggingFace repo and load it.
Prompt 4
Show me how to run the sudoku training script at the medium difficulty level.

Frequently asked questions

What is s-flm?

A research codebase for S-FLM, a language model that generates text by rotating points on a mathematical sphere instead of predicting words one at a time.

What language is s-flm written in?

Mainly Python. The stack also includes Python, PyTorch, HuggingFace.

What license does s-flm use?

No license information is stated in the README.

How hard is s-flm to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is s-flm for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.