Skip to content

Use Cases

Mike Wright edited this page Aug 1, 2026 · 2 revisions

Use Cases

MLPL is strongest when an experiment benefits from short array notation, explicit shapes, visible intermediate values, and a runnable explanation next to the code.

Learning array programming and machine learning

Use the browser tutorial to move from scalars and arrays through linear algebra, classical ML, autograd, neural networks, attention, fine-tuning, quantization concepts, image models, and architecture history. The glossary connects ML vocabulary to actual MLPL constructs.

Best surface: Browser and WASM.

Data exploration and visualization

Load or synthesize data, transform it with array operations, reduce dimensionality with PCA, t-SNE, UMAP-related/runtime reducers, MDS or random projection where available, then render labeled 2-D or 3-D views. This is useful for embeddings, clusters, decision boundaries, attention maps, confusion matrices, and training curves.

flowchart LR
    Data[Data or embeddings] --> Clean[Array transforms]
    Clean --> Reduce[Dimensionality reduction]
    Reduce --> Mark[Labels and semantic tags]
    Mark --> View[2-D, 3-D, or heatmap view]
    View --> Question[New question]
    Question --> Clean
Loading

Classical ML experiments

Worked demos cover logistic and softmax classification, k-means, PCA, k-nearest neighbors, Gaussian Naive Bayes, small MLPs, moons and circles datasets, and model comparison. These examples expose the array algebra instead of hiding it behind a large framework API.

Neural-network prototyping

Compose a model with the Model DSL, inspect its parameters, run a forward pass, calculate a loss, differentiate, and train. Named axes and typed ML values help explain what each tensor represents. Model and computation visualizations make this particularly useful for teaching architecture.

Tiny language models and attention

Train a byte/BPE tokenizer, construct embeddings and positional encodings, apply causal attention, optimize cross-entropy, and generate with sampling and top-k selection. The demos include tiny-LM, transformer-block, attention visualization, and Engram-enhanced tiny-LM work.

Use native CPU for portability, or a supported accelerated path after checking Apple Silicon and MLX or NVIDIA and CUDA.

LoRA fine-tuning

Freeze a base, attach low-rank adapters, train only the adapters, and inspect before/after behavior. CPU, MLX, and CUDA demo variants exist. The current GPU fast paths recognize specific model shapes; this is a demonstrable fine-tuning vertical slice, not a promise that every arbitrary model trains entirely on GPU.

Vision and image learning

The repository contains image-loading/evaluation components, patchification, CNN/ViT-oriented demos, attention-pattern galleries, and visualization assets. These are useful for explaining how an image becomes patches, how attention moves across them, and how prediction outputs can be inspected.

Games, self-play, and cellular automata

Tic-tac-toe demonstrates game logic, minimax/self-play data, policy models, and LoRA fine-tuning. Game of Life demos exercise array neighborhoods, rotation, nested structure, animated frames, pattern zoos, and the Gosper glider gun.

Neural Thickets and perturbation research

Clone a model, perturb parameters reproducibly, rank candidate specialists, and visualize specialization. This makes model ensembles and perturbation research concrete on CPU and on supported MLX paths.

Engram and upcoming mHC research

Engram is in progress. The repository can demonstrate deterministic n-gram addressing, trainable conditional memory, differentiable apply_engram, Engram statistics, and a CPU Tiny-LM with an Engram inserted after attention. The broader target includes persistent-device execution, an MLX Engram demo, injection into imported small/large models, scalable tables and checkpoints, and eventual CUDA parity.

mHC is planned soon. Its anticipated use case is to express and visualize Manifold-Constrained Hyper-Connections: constrained projection/parameterization operations and nontrivial residual-stream topology. No current mHC builtin or completed demo should be inferred from the planning/research documents.

LLM-assisted experimentation

Native MLPL can call an Ollama-compatible generation endpoint with llm_call and exposes an :ask workflow. Treat this as a tool integration around ML experiments, not the language's core purpose. Browser-only mode intentionally cannot silently contact local services; server proxying remains security-sensitive.

Resource feasibility studies

Estimate memory and time for actual or hypothetical model specifications, calibrate native hardware, and ask whether a workload is feasible before committing to it. Browser estimates work mathematically, but device calibration is more trustworthy in native mode.

Reproducible, remote labs

Run mlpl-serve on the machine that owns data or an accelerator. Connect a browser or terminal, keep session state on the server, stream metrics, cancel work, persist sessions, and store visualization artifacts. See Server and Remote Execution.

Clone this wiki locally