Course Details

Programming intelligent applications

MF0781

Course
Programming intelligent applications
Code
MF0781
Academic Year
2026/2027
Curriculum Year
2024/2025
Degree Programme
CHEMISTRY
Curriculum
000 - CORSO GENERICO
Course coordinator
Lecturers
Credits
6
Lecture Hours
48
Scientific Disciplinary Sector (SSD)
INF/01 - Computer Science
Course Type
Single-subject learning activity
Course Delivery
OPZ - Opzionale
Year
3
Teaching period
Secondo Semestre
Campus
VERCELLI
Teaching language
Italian
Course Contents
The course presents the theoretical foundations and practical tools required to design and develop artificial-intelligence-based software applications, with particular emphasis on Large Language Models (LLMs).

After a concise introduction to machine learning and neural networks, the course examines vector representations of text, attention mechanisms, the Transformer architecture, the LLM lifecycle, generation strategies, efficiency techniques and evaluation criteria.

The application-oriented part covers the use of models through APIs or local inference, prompt and context engineering, structured outputs, tool calling, interoperability protocols, AI-assisted programming, Retrieval-Augmented Generation and the design of agents, workflows and agent teams.

The course also addresses memory, tracing, guardrails, human interaction, deployment, quantisation and the integration of user interfaces with AI backends.
Reference Texts
Main textbook
Jay Alammar, Maarten Grootendorst, Hands-On Large Language Models: Language Understanding and Generation, O’Reilly Media, 2024.

Supplementary textbooks
Sebastian Raschka, Build a Large Language Model (From Scratch), Manning Publications, 2024.
Afshine Amidi, Shervine Amidi, Super Study Guide: Transformers & Large Language Models, Amazon Fulfillment, 2024.
Learning Outcomes
The course is worth 6 ECTS credits and includes 48 contact hours, approximately divided into 36 hours of teacher-led instruction and 12 hours of interactive teaching, as well as 102 hours of independent study.

The overall objective is to provide the knowledge and skills required to understand, design, implement and evaluate software applications based on generative artificial intelligence models.

By the end of the course, students are expected to be able to:
1. Explain the essential principles of neural networks, attention, Transformers and Large Language Models;
2. Use pretrained models, through remote services or local inference, within software applications;
3. Design and implement components based on prompting, structured outputs, external tools, RAG systems and agents;
4. Critically evaluate models and application architectures in terms of output quality, reliability, latency, cost, privacy, security and deployment constraints;
5. Document and present design decisions, experimental results and the limitations of an AI-based system using appropriate technical terminology.

The course contributes to the development of applied computer science skills by providing tools for integrating artificial intelligence methods into the design and development of contemporary software systems.
Prerequisites
Basic knowledge of Python programming is required, including data types and structures, functions, classes, module management and the use of external libraries.

Introductory knowledge of linear algebra is also required, particularly vectors, matrices and matrix operations, together with a basic understanding of derivatives.

Familiarity with the command line, Git, Python virtual environments and the principles of HTTP/REST APIs is useful, although these topics will be reviewed when necessary.

No specialised prior knowledge of Large Language Models is required.
Teaching Methods
The course includes approximately 36 hours of teacher-led instruction and 12 hours of interactive teaching, mainly carried out in a computer laboratory.

Classes combine:
- Presentation and discussion of theoretical concepts;
- Worked examples and live-coding sessions;
- Guided exercises performed individually or in small groups;
- Comparative analysis of models, architectures and implementation strategies;
- Incremental development of AI-based software components;
- Design and experimental activities related to the examination project.

The exercises allow students to apply the concepts directly, examine model behaviour, observe common failure modes and become familiar with software libraries, APIs and development tools.

Slides, notebooks, source code, exercise instructions and supplementary materials will be published on the DIR platform. Specific versions of software libraries and tools may be updated to reflect technological developments, without changing the learning objectives or the core course content.

Non-attending students are subject to the same programme and assessment methods and are expected to consult the materials published on the DIR platform regularly.
Additional Information
Announcements, teaching materials, code examples, exercise instructions and information concerning the project will be published on the DIR platform.

The examination project must be agreed upon with or approved by the course instructor before its final development. For group projects, all group members must be familiar with the complete system and must be able to explain their own contribution and the main design decisions.

Students with disabilities, Specific Learning Disorders — SLDs — or Special Educational Needs — SEN — may request the dedicated services and support tools provided by the University by contacting the office responsible for student careers and services and consulting the relevant University webpage.

After contacting the appropriate University office, students may contact the course instructor to agree on how the approved measures will be applied to teaching activities and assessment procedures.
Assessment Methods
The examination consists of two compulsory parts.

1. Practical project — two thirds of the final grade

The project may be carried out individually or in a group of up to three students. Students may propose their own topic, subject to the instructor’s approval, or select one of the project proposals made available during the course.

The submission includes:

the source code of the developed system;
the instructions required to run it or reproduce its results;
a short technical report describing the objectives, architecture, tools and models used, design decisions, evaluation procedures, results and identified limitations;
a demonstration and discussion of the system.

The project is assessed according to:
- Functional correctness and robustness in the intended use cases;
- Suitability of the architecture and techniques adopted;
- Ability to evaluate results and identify errors, limitations and possible risks;
- Awareness of trade-offs among quality, latency, cost, privacy, security and maintainability;
- Quality of the code, documentation and reproducibility;
- Ability to justify design decisions and answer questions during the discussion.

For group projects, each student’s individual contribution is also assessed. Members of the same group may therefore receive different grades.

2. Individual written examination — one third of the final grade

The written examination covers the entire course programme and includes theoretical questions, short open-ended questions and/or analysis and design exercises.

The examination assesses:
- Knowledge of the theoretical and methodological foundations;
- Understanding of the architectures and techniques covered in the course;
- Ability to compare alternative solutions;
- Ability to identify the most appropriate technique for an application scenario;
- Ability to recognise limitations, errors and common failure modes of LLM-based systems.

Submission and discussion of the project are required before taking the written examination. A grade of at least 18/30 must be obtained in each part.

The final grade is calculated by assigning a weight of two thirds to the project grade and one third to the written-examination grade.

To pass the examination, students must demonstrate an understanding of the fundamental concepts, present a project that works in the main intended use cases and be able to describe and justify the essential design decisions.

Grades above the minimum passing level require greater completeness and accuracy, the ability to connect different topics, autonomy in problem analysis and critical evaluation of results.

The award of 30/30 cum laude requires the maximum grade in both parts and an excellent level of technical and documentary quality in the project, depth of critical analysis, demonstrated autonomy and clarity of presentation.
Detailed Syllabus
1. Artificial intelligence and neural-network foundations
- Historical development of artificial intelligence and machine-learning paradigms.
- Perceptron, deep neural networks, loss functions, gradient descent and backpropagation.
- Vanishing gradients, batch normalisation, skip connections and an introduction to PyTorch.

2. Large Language Models and the Transformer architecture
- Tokenisation, embeddings, self-attention and the Transformer architecture.
- LLM decoding strategies, training and evaluation.
- Flash Attention, Paged Attention, Mixture of Experts and efficient inference.

3. Development of LLM-based applications
- Use of models through APIs and local inference.
- Prompt engineering and context engineering.
- Structured outputs and tool calling.
- Introduction to the Model Context Protocol (MCP).

4. AI-assisted programming
- Coding agents and Spec-Driven Development.
- Critical use of AI programming assistants.
- Verification and review of generated code.

5. Retrieval-Augmented Generation (RAG)
- Structure of a RAG pipeline.
- Dense retrieval, BM25 and hybrid retrieval.
- Query rewriting and re-ranking.
- Construction and evaluation of the context supplied to the model.

6. Agents and agentic systems
- ReAct pattern and implementation of LLM-based agents.
- Agents, workflows and agent teams.
- Tools, sessions, state, tracing, memory and knowledge bases.
- Human-in-the-loop mechanisms and guardrails.

7. Deployment and integration
- Local inference, quantisation, hardware requirements and limitations.
- Integration between user interfaces and AI backends.
- Protocols for agentic applications, including AG-UI.

8. Laboratory activities
- Exercises with PyTorch.
- Use of inference APIs.
- Generation of structured outputs and tool calling.
- Implementation of agents and RAG pipelines.

Integration of the gender dimension
Examples of bias in data and model outputs, including cases of gender-based discrimination, will be discussed together with the main detection and mitigation techniques.
Expected Learning Outcomes
Knowledge and understanding
By the end of the course, students will be able to:
- describe the essential principles of neural networks and their training;
- explain tokenisation, embeddings, self-attention and the Transformer architecture;
- describe the operation, capabilities and limitations of Large Language Models;
- distinguish among prompt engineering, RAG, workflows and agents.

Applying knowledge and understanding
Students will be able to:
- use remote or local models within a software application;
- generate structured outputs and integrate external tools;
- design a RAG pipeline;
- implement a simple agent or workflow;
- apply testing, tracing and evaluation procedures.

Making judgements
Students will be able to:
- compare different models and architectures;
- select solutions consistent with application requirements;
- assess quality, cost, latency, robustness, privacy and security;
- identify the main limitations and failure modes of LLM-based systems.

Communication skills
Students will be able to:
- document and present an artificial-intelligence-based system;
- explain its architecture, results, design decisions and limitations;
- use appropriate technical terminology.

Learning skills
Students will be able to:
- consult technical documentation independently;
- understand and adapt software examples;
- learn new tools and technologies in a rapidly evolving field.

Minimum required level
To pass the examination, students must understand the fundamental concepts and be able to develop and describe a working application of limited complexity.

Advanced level
Higher grades require design autonomy, the ability to integrate multiple components and critical analysis of the results and limitations of the implemented solution.
Last update:09-09-2026 00:14:31