Instructions to use AlexWortega/lfm2-physics with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use AlexWortega/lfm2-physics with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- Unsloth Studio new
How to use AlexWortega/lfm2-physics with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for AlexWortega/lfm2-physics to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for AlexWortega/lfm2-physics to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for AlexWortega/lfm2-physics to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="AlexWortega/lfm2-physics", max_seq_length=2048, )
Upload lfm2-physics
Browse files
README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: LiquidAI/LFM2-350M
|
| 4 |
+
library_name: peft
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
tags:
|
| 7 |
+
- physics
|
| 8 |
+
- next-frame-prediction
|
| 9 |
+
- lora
|
| 10 |
+
- sft
|
| 11 |
+
- trl
|
| 12 |
+
- unsloth
|
| 13 |
+
- icml-2026
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# lfm2-physics
|
| 17 |
+
|
| 18 |
+
LoRA fine-tune of `LiquidAI/LFM2-350M` for 2D rigid body physics next-frame prediction. Part of an ICML-2026 study comparing fine-tuned LMs vs. from-scratch GPTs on physics trajectory modelling.
|
| 19 |
+
|
| 20 |
+
## Adapter details
|
| 21 |
+
|
| 22 |
+
- **Base**: `LiquidAI/LFM2-350M`
|
| 23 |
+
- **Adapter type**: LoRA, r=32, alpha=64, dropout=0.0
|
| 24 |
+
- **Target modules**: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
|
| 25 |
+
- **Trainer**: `SFTTrainer` (TRL) via Unsloth
|
| 26 |
+
- **Curriculum**: 5 stages of increasing scene complexity
|
| 27 |
+
- **Task**: autoregressive next-frame prediction over 200-frame rigid-body scenes
|
| 28 |
+
|
| 29 |
+
## Stages
|
| 30 |
+
|
| 31 |
+
- `stage0/` ... `stage4/` — checkpoints from each curriculum stage
|
| 32 |
+
- `final/` — final adapter after all stages
|
| 33 |
+
|
| 34 |
+
Each stage directory contains an Unsloth-saved adapter (`adapter_config.json`, `adapter_model.safetensors`, tokenizer files).
|
| 35 |
+
|
| 36 |
+
## Usage
|
| 37 |
+
|
| 38 |
+
```python
|
| 39 |
+
from peft import PeftModel
|
| 40 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 41 |
+
|
| 42 |
+
base = AutoModelForCausalLM.from_pretrained("LiquidAI/LFM2-350M")
|
| 43 |
+
model = PeftModel.from_pretrained(base, "AlexWortega/lfm2-physics", subfolder="final")
|
| 44 |
+
tokenizer = AutoTokenizer.from_pretrained("AlexWortega/lfm2-physics", subfolder="final")
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
## Training data
|
| 48 |
+
|
| 49 |
+
Trained on ~900K scenes across 24 "seen" scenario types. See [physics-scenarios-packed](https://huggingface.co/datasets/AlexWortega/physics-scenarios-packed).
|
| 50 |
+
|
| 51 |
+
## Citation
|
| 52 |
+
|
| 53 |
+
ICML-2026 submission (in progress).
|