Mitigando Alucinações no Ensino de Lógica de Programação: Uma Avaliação de Agentes Conversacionais Baseados em RAG

  • Igor Santos Universidade Federal do Sul e Sudeste do Pará (UNIFESSPA)
  • Martiniano Gomes Universidade Federal do Sul e Sudeste do Pará (UNIFESSPA)
  • Vitória Leda Universidade Federal do Sul e Sudeste do Pará (UNIFESSPA)
  • Marcus Coelho Universidade Federal do Sul e Sudeste do Pará (UNIFESSPA)
  • Ramon Barbosa Universidade Federal do Sul e Sudeste do Pará (UNIFESSPA)
  • Aline Valente Universidade Federal do Pará (UFPA)
  • Warley Junior Universidade Federal do Sul e Sudeste do Pará (UNIFESSPA)
  • Elton Alves Universidade Federal do Sul e Sudeste do Pará (UNIFESSPA)

Resumo


Agentes conversacionais no ensino de programação sofrem com alucinações dos modelos de linguagem. Embora o RAG resolva isso ancorando respostas em materiais didáticos, resta definir qual arquitetura equilibra melhor custo e precisão. Para preencher essa lacuna, este estudo realizou um benchmarking de seis abordagens RAG no ensino de lógica. Os resultados mostram que modelos de passo único (Context e Self RAG) atingiram maior fidelidade e relevância semântica, consumindo apenas 1200 tokens em 4 segundos. Conclui-se que arquiteturas RAG simples superam abordagens em grafos, unindo precisão pedagógica e eficiência operacional.
Palavras-chave: Agentes Conversacionais, Retrieval-Augmented Generation, Ensino de Programação

Referências

Ahmed, M., Dorrah, M., Ashraf, A., Adel, Y., Elatrozy, A., Mohamed, B. E., and Gomaa, W. (2024). Codeqa: Advanced programming question-answering using llm agent and rag. In 2024 6th Novel Intelligent and Leading Emerging Sciences Conference (NILES), pages 494–499. IEEE.

Alario-Hoyos, C., Kemcha, R., Kloos, C. D., Callejo, P., Estévez-Ayres, I., Santín-Cristóbal, D., Cruz-Argudo, F., and López-Sánchez, J. L. (2024). Tailoring your code companion: Leveraging llms and rag to develop a chatbot to support students in a programming course. In 2024 IEEE International Conference on Teaching, Assessment and Learning for Engineering (TALE), pages 1–8. IEEE.

Asai, A., Wu, Z., Wang, Y., Sil, A., and Hajishirzi, H. (2024). Self-rag: Learning to retrieve, generate, and critique through self-reflection. In International conference on learning representations, volume 2024, pages 9112–9141.

Barzanji, C. and Loitsch, C. (2025). Exploring conversational agents for novice programmers: a scoping review. Discover Artificial Intelligence, 5(1):271.

Borges, J. M. (2025). Desenvolvimento e avaliação de chatbot pedagógico open source com rag para educação online.

Das, R. and Cheng, Q. (2025). Graphrag-augmented mastery modeling for student programming learning trajectory prediction and explanation via fuzzy clustering. In 2025 IEEE International Conference on Data Mining Workshops (ICDMW), pages 3263–3268. IEEE.

Es, S., James, J., Anke, L. E., and Schockaert, S. (2024). Ragas: Automated evaluation of retrieval augmented generation. In Proceedings of the 18th conference of the european chapter of the association for computational linguistics: system demonstrations, pages 150–158.

LangChain, Inc. (2024). Langsmith: The platform for agent engineering. Acesso em: 27 maio 2026.

Lin, Y., Khan, M. F. F., and Sakamura, K. (2025). Athena: A genai-powered programming tutor based on open-source llm. In 2025 1st International Conference on Consumer Technology (ICCT-Pacific), pages 1–4. IEEE.

Ma, I., Krone-Martins, A., and Videira Lopes, C. (2024). Integrating ai tutors in a programming course. In Proceedings of the 2024 on ACM Virtual Global Computing Education Conference V. 1, pages 130–136.

Petrin, N. S. M. and Néto, J. C. (2026). Empathiced: um chatbot educacional com rag e computação afetiva em um contexto de iniciação científica coordenada. ARACÊ, 8(3):e12683–e12683.

Prosvirnin, R., Kuznetsov, S., and Jin, S. (2026). Contextrag: Extraction-free hierarchical graph construction for retrieval-augmented generation. arXiv preprint arXiv:2605.19735.

Sarmah, B., Mehta, D., Hall, B., Rao, R., Patel, S., and Pasquali, S. (2024). Hybridrag: Integrating knowledge graphs and vector retrieval augmented generation for efficient information extraction. In Proceedings of the 5th ACM International Conference on AI in Finance, pages 608–616.

Sun, Y., Sun, K., Xu, Y. E., Yang, X., Dong, X. L., Tang, N., and Chen, L. (2025). Kerag: Knowledge-enhanced retrieval-augmented generation for advanced question answering. In Findings of the Association for Computational Linguistics: EMNLP 2025, pages 6194–6216.

Wu, J.-W. and Tseng, M.-H. (2025). Developing a local generative ai teaching assistant system: Utilizing retrieval-augmented generation technology to enhance the campus learning environment. Electronics, 14(17):3402.

Yang, C. C., Liu, G.-J., and Yu, C.-J. (2025). Optimizing rag in programming education: A comparative study of models and strategies. IEEE Access, 13:190890–190903.

Yuan, H., Liu, Z., Qin, M., Qian, H., Shu, Y., Dou, Z., Wen, J.-R., and Sebe, N. (2025). Memory-enhanced retrieval augmentation for long video understanding. arXiv preprint arXiv:2503.09149.

Zhao, H., Wu, Y., Lu, Z., Yu, X., Miao, W., and Chen, L. (2026). Sagejavon: A scalable ai tutor for personalized programming learning. Information Processing & Management, 63(5):104605.
Publicado
05/10/2026
SANTOS, Igor; GOMES, Martiniano; LEDA, Vitória; COELHO, Marcus; BARBOSA, Ramon; VALENTE, Aline; JUNIOR, Warley; ALVES, Elton. Mitigando Alucinações no Ensino de Lógica de Programação: Uma Avaliação de Agentes Conversacionais Baseados em RAG. In: SIMPÓSIO BRASILEIRO DE INFORMÁTICA NA EDUCAÇÃO (SBIE), 37. , 2026, Goiânia/GO. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2026 . p. 1620-1633. DOI: https://doi.org/10.5753/sbie.2026.28028.