Persian Educational Content Generation from PDF Documents Using Local Large Language Models: A Comparative Study of RAG and Key-Topic-Based Approaches
Persian Educational Content Generation from PDF Documents Using Local Large Language Models: A Comparative Study of RAG and Key-Topic-Based Approaches
Amir Hossein Baradaran1 Saeedeh Sadat Sadidpour2 Reza Bahrami Darasleh3
1) PhD student in Artificial Intelligence, Malek Ashtar University of Technology
2) Assistant Professor of Artificial Intelligence, Malek Ashtar University of Technology
3) Master s degree student in Artificial Intelligence, Malek Ashtar University of Technology
IOI Code
:
AAHD-ABKEGG
Publication :
National Conference on Information Technology, Nanotechnology, Artificial Intelligence and Technological Futures Studies(itnaf.ir)
Abstract :
Large language models (LLMs) have demonstrated considerable potential for supporting educational applications, particularly in automated instructional material generation. However, the effectiveness of different document-grounding strategies and lightweight local LLMs for generating Persian educational content remains insufficiently explored. This paper presents a comparative framework for automatically generating educational content from PDF documents using locally deployed quantized language models. Two generation pipelines are investigated. The first employs document segmentation, sentence embeddings, semantic retrieval, and a FAISS vector database to implement a retrieval-augmented generation (RAG) workflow. The second identifies representative topics from the source document using TF–IDF and cosine similarity and subsequently prompts an LLM to generate structured educational explanations, examples, and summaries for the extracted topics. Five locally executable language models, including Llama 3.1, Llama 3.2, Aya, DeepSeek-R1, and Gemma2, are comparatively evaluated in terms of generated-content quality, processing time, and observed output characteristics. Experimental observations show that the key-topic-based generation strategy produced more satisfactory educational content than the investigated RAG configuration. Among the evaluated models, Aya achieved the highest qualitative assessment, producing very good educational content, while Llama 3.1 provided a favorable balance between output quality and processing time. The results demonstrate the feasibility of constructing offline and resource-conscious educational content generation systems using lightweight local LLMs and highlight the importance of retrieval strategy, prompt design, and model selection in document-grounded educational generation.
Keywords : large language models educational content generation persian natural language processing retrieval augmented generation tf idf local llms