Views
No views yet
NL premises + question
│
▼
T5-base Encoder (frozen, 768d, 12L)
│ cross-attention
▼
Translation Decoder (4L, 512d)
│
▼
FOL premises + FOL question
│
▼
clingo ASP solver (symbolic reasoner)
│
▼
Answer (True / False / Unknown) + proof chaint5-base encoder, all weights frozen. Encodes the NL input; provides rich contextual representations to the decoder via cross-attention.<extra_id_0> to separate premises from the question in encoder input. Generation stops at <extra_id_3>.pos_False, neg_True) ~11× to match dominant class frequency| Metric | Score |
|---|---|
| Premises FOL accuracy (fuzzy) | 85.8% |
| Question FOL exact match | 91.1% (60,621 / 66,556) |
1from huggingface_hub import hf_hub_download
2from scripts.pipeline import load_model, run
3
4# Download checkpoint
5ckpt_path = hf_hub_download(repo_id="Venkatdatta/fol-slm", filename="checkpoint_final.pt")
6
7# Load (once)
8load_model(ckpt_path, config_path="configs/v12_translation.yaml")
9
10# Run
11result = run(
12 nl_premises="Venkat is perseverant. Venkat is curious. Venkat is intuitive. "
13 "If someone is curious and intuitive they explore. "
14 "If someone is perseverant and explores they discover.",
15 nl_question="Venkat discovers.",
16)
17
18print(result["answer"]) # "True"
19print(result["fol_premises"]) # list of FOL premise strings
20print(result["fol_question"]) # FOL question string
21for step in result["proof"]:
22 print(step)Anne is kind. Bob is furry. If someone is kind then they are furry. If someone is furry then they are green.
Anne is green.
Kind(anne)
Furry(bob)
forall x (Kind(x) -> Furry(x))
forall x (Furry(x) -> Green(x))
Question: Green(anne)Kind(anne) and forall x (Kind(x) -> Furry(x)) -> therefore Furry(anne)
Furry(anne) and forall x (Furry(x) -> Green(x)) -> therefore Green(anne)pos_False and neg_True cases (non-negated→False, negated→True) are rare in the training data and likely harder for the model.1@misc{fol-slm-2026,
2 author = {Venkat Datta Bommena},
3 title = {FOL SLM: Natural Language to First-Order Logic with Symbolic Reasoning},
4 year = {2026},
5 url = {https://huggingface.co/Venkatdatta/fol-slm}
6}1@misc{mathurinache-proofwriter-kaggle,
2 author = {mathurinache},
3 title = {ProofWriter},
4 year = {2021},
5 url = {https://www.kaggle.com/datasets/mathurinache/proofwriter},
6 note = {Kaggle dataset}
7}