This repository contains the GGUF model of Phi-3.5-PCS-Finetuned, a version of Microsoft's Phi-3.5-mini-instruct model, fine-tuned for interpreting Pre-Conceptual Schemas (PCS).
This work is the result of the master's thesis project "Natural Language Processing in Pre-conceptual Schemas for Representing Knowledge by Using Large Language Models" from the Master's Degree in Systems and Computing Engineering at the University of Nariño.
Authors: Felipe Roa Narváez, Jesús Insuasti, Ph.D.
Affiliation: University of Nariño
Base Model: microsoft/Phi-3.5-mini-instruct
Model Description
The model is specialized in transforming a structured representation of a Pre-Conceptual Schema—specifically a list of semantic triads (subject-predicate-object)—into a coherent, human-readable description in natural language. The goal is to enable the automatic interpretation of these diagrams, which are used for knowledge representation.
Intended Use
The primary use of this model is to serve as an inference engine in tools that require the automatic interpretation of Pre-Conceptual Schemas. It takes a list of triads in JSON format and generates an explanatory paragraph.
How to Use
This model is in GGUF format, so it can be run efficiently on a CPU or GPU using libraries like llama-cpp-python.
Python
from llama\_cpp import Llama
# Load the GGUF model
llm = Llama(
model\_path="./path/to/your/model.gguf",
n_ctx=4096, # Context window
n_threads=8, # Number of CPU threads to use
n_gpu_layers=-1 # Offload all possible layers to the GPU
)
# Define the instruction and the pre-conceptual schema input
instruction = "Interpret the following pre-conceptual schema"
schema\_input = [
{"subject": "PROGRAMMER", "predicate": "HAS", "object": "SKILLS"},
{"subject": "PROGRAMMER", "predicate": "TYPES", "object": "CODE"},
{"subject": "CODE", "predicate": "IS", "object": "OBJECT"},
{"subject": "END USER", "predicate": "RUNS", "object": "EXECUTABLE"}
]
# Format the prompt as expected by the model
prompt = f"### Instruction:\n{instruction}\n\n### Input:\n{schema_input}\n\n### Response:\n"
# Generate the interpretation
output = llm(
prompt,
max_tokens=256,
stop=["###"], # Stop generation at the stop token
echo=False
)
print(output['choices'][0]['text'].strip())
Fine-Tuning Process
Dataset: The model was fine-tuned on a linguistic corpus of 538 unique examples , built from Pre-Conceptual Schemas extracted from academic theses. The data was structured in the Alpaca format (instruction, input, output).
Training Framework: A parameter-efficient fine-tuning (PEFT) strategy with QLoRA was used , accelerated by the Unsloth library to optimize memory usage and training speed.
Evaluation
The model was validated using a test set unseen during training. The results showed a significant improvement compared to the untuned base model , achieving a
BERTScore F1 of 0.90 and high ratings from human experts on:
Fluency: 4.8 / 5
Coherence: 4.7 / 5
Accuracy and Relevance: 4.6 / 5
This demonstrates that the model not only generates grammatically correct text but also effectively captures the semantics and logic of the schemas.
Citation
If you use this model in your research, please cite the original work:
@mastersthesis{RoaInsuasti2025,
author = {Felipe Roa Narváez, Jesús Insuasti},
title = {Natural Language Processing in Pre-conceptual Schemas for Representing Knowledge by Using Large Language Models},
school = {Universidad de Nariño},
year = {2025},
address = {San Juan de Pasto, Colombia}
}