Views
No views yet
google/flan-t5-xxl. It was trained to translate natural language statements into First-Order Logic (FOL) representations.google/flan-t5-xxl, which is released under the Apache 2.0 License. These adapter weights are also released under the Apache 2.0 License.1import torch
2from transformers import T5Tokenizer, T5ForConditionalGeneration
3
4# Load tokenizer and model
5model_path = "fvossel/flan-t5-xxl-nl-to-fol" # or local path if not pushed to HF
6tokenizer = T5Tokenizer.from_pretrained(model_path)
7model = T5ForConditionalGeneration.from_pretrained(model_path, device_map="auto", torch_dtype=torch.bfloat16)
8
9# Example NL input
10nl_input = "All dogs are animals."
11
12# Preprocess prompt
13input_text = "translate English natural language statements into first-order logic (FOL): " + nl_input
14inputs = tokenizer(input_text, return_tensors="pt", padding=True).to("cuda")
15
16# Generate prediction
17with torch.no_grad():
18 outputs = model.generate(
19 inputs["input_ids"],
20 max_length=256,
21 min_length=1,
22 num_beams=5,
23 length_penalty=2.0,
24 early_stopping=False,
25 )
26
27# Decode and print result
28print(tokenizer.decode(outputs[0], skip_special_tokens=True))google/flan-t5-xxl model with:ddp_find_unused_parameters=Falseddp_backend="nccl"@misc{vossel2025advancingnaturallanguageformalization,
title={Advancing Natural Language Formalization to First Order Logic with Fine-tuned LLMs},
author={Felix Vossel and Till Mossakowski and Björn Gehrke},
year={2025},
eprint={2509.22338},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2509.22338},
}