This repository contains the code and resources for my diploma thesis. The project explores the use of Large Language Models (LLMs) in analyzing tabular data using natural language by generation and execution of Python code. The thesis includes a comprehensive literature review, development of an LLM-based Agent program, and performance evaluations using fine-tuned and state-of-the-art models.
The project is organized as follows:
TableQA-LLMAgent/ # Root directory
β
βββ .github/ # CI/CD workflows
β βββ workflows/
β
βββ README.md # This README file
βββ main.py # Agent usage example
βββ poetry.lock # Poetry dependency management
βββ pyproject.toml # Readable dependencies
β
βββ tableqallmagent/ # Source code of the package
β βββ __init__.py
β βββ agent.py # Constructor and the main interface
β βββ code_manipulation.py # Processing generated code
β βββ coder_llms.py # Forward passes for coding LLMs
β βββ llms.py # Higher level methods for LLMs
β βββ logger.py # Color constants for readability
β βββ prompts.py # Prompting strategies and formatting
β
βββ dataset/ # Multiple datasets and preprocessing
βββ dist/ # PyPI versions
βββ evaluation/ # LLM-as-evaluator
βββ finetuning/ # LoRA training scripts and configs
βββ plots/ # Directory to store generated images
βββ tests/ # pytest
To get started with the project, follow these steps:
-
Clone the repository:
git clone https://github.com/poludmik/TableQA-LLMAgent.git cd TableQA-LLMAgent
-
Install the dependencies:
poetry install
You can run the main script to see the basic example functionalities of the agent:
python main.py
- Fine-Tuning: Fine-tuning LLMs using LoRA and QLoRA techniques.
- Code Generation: Generating Python code to analyze tabular data.
- Model Evaluation: Rigorous benchmarks for evaluating LLM Agents.
- MLOps: Tracking experiments using MLOps tools to ensure reproducibility.
The fine-tuning experiments significantly improved the performance of the Code Llama 7B Python model from 35.3% to 60.3% on the proposed evaluation benchmark.
For any questions or feedback, please reach out to me:
Mikhail Poludin
michael.poludin@gmail.com
This project is licensed under the MIT License.