Small language models (up to 4 billion parameters), quantized to run on consumer hardware, promise on-premise AI assistants and agents that keep sensitive industrial data local. Their viability for real manufacturing tasks—rather than synthetic benchmarks—remains poorly characterized, however, especially under the joint constraints of quality, latency and energy. This thesis investigates whether such models can serve both as multimodal assistants and as function-calling agents over a real CNC-tooling dataset, on a single consumer workstation (Intel Core i5-14600K, 64 GB DDR5 RAM, NVIDIA RTX 5070 Ti; Q4_K_M quantization), with per-task energy telemetry. Part 1 benchmarks fifteen models on text, image and audio understanding across three inference frameworks (Transformers, llama.cpp, vLLM) on CPU and GPU. Quality is found to depend on the model and on weight precision rather than on the hardware; GGUF quantization (llama.cpp) is the most efficient backend, and the GPU is 10–80× more energy-efficient per task than the CPU despite its higher instantaneous power draw. The Gemma family attains the highest quality at full precision but is markedly sensitive to quantization, whereas Qwen3.5 benefits from it; Qwen3-4B-Instruct is the most portable choice across frameworks. Part 2 decomposes function calling into four causal axes—catalog cardinality and pre-LLM routing (a pre-filter that selects which tools the model sees), multi-step composition, domain and linguistic register (with two pre-registered hypotheses), and intra-family scaling (Qwen3.5 from 0.8 to 9 B). The central finding, recurring across all axes, is the answer-gap: a model can select the correct tool with the correct parameters and yet fail to verbalize the result, so end-to-end call-correctness—and BFCL-style metrics—systematically overestimate user-facing usefulness. Qwen3.5-4B emerges as the only robust agent: it wins as the tool catalog grows and is the only genuine multi-step composer, while function-calling capability emerges below 2 B and saturates at 4 B (the 9 B model offers no measurable gain). Both pre-registered domain hypotheses are falsified. Beyond the empirical results, the thesis contributes an energy-aware evaluation of small models on a real manufacturing task, the identification and quantification of the answer-gap, and a robust scoring protocol—pre-registered hypotheses, a grounded answer metric, and sensitivity bounds—that decouples the conclusions from any single scoring choice.

I modelli linguistici di piccola taglia (fino a 4 miliardi di parametri), quantizzati per essere eseguiti su hardware consumer, promettono assistenti e agenti AI eseguibili in locale, mantenendo i dati industriali sensibili all'interno dell'azienda. La loro reale utilizzabilità su compiti manifatturieri concreti—e non solo su benchmark sintetici—resta però poco caratterizzata, soprattutto sotto i vincoli congiunti di qualità, latenza e consumo energetico. Questa tesi indaga se tali modelli possano fungere sia da assistenti multimodali sia da agenti di function calling su un dataset reale di utensili CNC, su una singola workstation consumer (Intel Core i5-14600K, 64 GB di RAM DDR5, NVIDIA RTX 5070 Ti; quantizzazione Q4_K_M), con misura energetica per singolo task. La Parte 1 confronta quindici modelli su comprensione di testo, immagini e audio attraverso tre framework di inferenza (Transformers, llama.cpp, vLLM) su CPU e GPU. La qualità dipende dal modello e dalla precisione dei pesi più che dall'hardware; la quantizzazione GGUF (llama.cpp) è il backend più efficiente e la GPU è 10–80× più efficiente energeticamente della CPU per singolo task, nonostante l'assorbimento istantaneo maggiore. La famiglia Gemma raggiunge la qualità più alta a precisione piena ma è marcatamente sensibile alla quantizzazione, mentre Qwen3.5 ne beneficia; Qwen3-4B-Instruct è la scelta più portabile fra i framework. La Parte 2 scompone il function calling in quattro assi causali—cardinalità del catalogo e routing pre-LLM (un pre-filtro che seleziona quali strumenti vede il modello), composizione multi-step, dominio e registro linguistico (con due ipotesi pre-registrate) e scaling intra-famiglia (Qwen3.5 da 0,8 a 9 B). Il risultato centrale, ricorrente su tutti gli assi, è l'answer-gap: un modello può selezionare lo strumento corretto con i parametri corretti e tuttavia non verbalizzare il risultato, sicché la correttezza end-to-end della chiamata—e le metriche in stile BFCL—sovrastima sistematicamente l'utilità per l'utente. Qwen3.5-4B emerge come unico agente robusto: vince al crescere del catalogo di strumenti ed è l'unico vero compositore multi-step, mentre la capacità di function calling emerge sotto i 2 B e satura a 4 B (il modello da 9 B non offre alcun guadagno misurabile). Entrambe le ipotesi pre-registrate sul dominio risultano falsificate. Oltre ai risultati empirici, la tesi contribuisce una valutazione energy-aware dei modelli piccoli su un compito manifatturiero reale, l'identificazione e la quantificazione dell'answer-gap, e un protocollo di scoring robusto—ipotesi pre-registrate, una metrica della risposta grounded e bound di sensitivity—che rende le conclusioni indipendenti dalla singola scelta di valutazione.

LLM pipelines applied to manufacturing: a pathway to integration and automation

Pelonzi, Giacomo
2025/2026

Abstract

Small language models (up to 4 billion parameters), quantized to run on consumer hardware, promise on-premise AI assistants and agents that keep sensitive industrial data local. Their viability for real manufacturing tasks—rather than synthetic benchmarks—remains poorly characterized, however, especially under the joint constraints of quality, latency and energy. This thesis investigates whether such models can serve both as multimodal assistants and as function-calling agents over a real CNC-tooling dataset, on a single consumer workstation (Intel Core i5-14600K, 64 GB DDR5 RAM, NVIDIA RTX 5070 Ti; Q4_K_M quantization), with per-task energy telemetry. Part 1 benchmarks fifteen models on text, image and audio understanding across three inference frameworks (Transformers, llama.cpp, vLLM) on CPU and GPU. Quality is found to depend on the model and on weight precision rather than on the hardware; GGUF quantization (llama.cpp) is the most efficient backend, and the GPU is 10–80× more energy-efficient per task than the CPU despite its higher instantaneous power draw. The Gemma family attains the highest quality at full precision but is markedly sensitive to quantization, whereas Qwen3.5 benefits from it; Qwen3-4B-Instruct is the most portable choice across frameworks. Part 2 decomposes function calling into four causal axes—catalog cardinality and pre-LLM routing (a pre-filter that selects which tools the model sees), multi-step composition, domain and linguistic register (with two pre-registered hypotheses), and intra-family scaling (Qwen3.5 from 0.8 to 9 B). The central finding, recurring across all axes, is the answer-gap: a model can select the correct tool with the correct parameters and yet fail to verbalize the result, so end-to-end call-correctness—and BFCL-style metrics—systematically overestimate user-facing usefulness. Qwen3.5-4B emerges as the only robust agent: it wins as the tool catalog grows and is the only genuine multi-step composer, while function-calling capability emerges below 2 B and saturates at 4 B (the 9 B model offers no measurable gain). Both pre-registered domain hypotheses are falsified. Beyond the empirical results, the thesis contributes an energy-aware evaluation of small models on a real manufacturing task, the identification and quantification of the answer-gap, and a robust scoring protocol—pre-registered hypotheses, a grounded answer metric, and sensitivity bounds—that decouples the conclusions from any single scoring choice.
ING - Scuola di Ingegneria Industriale e dell'Informazione
22-lug-2026
2025/2026
I modelli linguistici di piccola taglia (fino a 4 miliardi di parametri), quantizzati per essere eseguiti su hardware consumer, promettono assistenti e agenti AI eseguibili in locale, mantenendo i dati industriali sensibili all'interno dell'azienda. La loro reale utilizzabilità su compiti manifatturieri concreti—e non solo su benchmark sintetici—resta però poco caratterizzata, soprattutto sotto i vincoli congiunti di qualità, latenza e consumo energetico. Questa tesi indaga se tali modelli possano fungere sia da assistenti multimodali sia da agenti di function calling su un dataset reale di utensili CNC, su una singola workstation consumer (Intel Core i5-14600K, 64 GB di RAM DDR5, NVIDIA RTX 5070 Ti; quantizzazione Q4_K_M), con misura energetica per singolo task. La Parte 1 confronta quindici modelli su comprensione di testo, immagini e audio attraverso tre framework di inferenza (Transformers, llama.cpp, vLLM) su CPU e GPU. La qualità dipende dal modello e dalla precisione dei pesi più che dall'hardware; la quantizzazione GGUF (llama.cpp) è il backend più efficiente e la GPU è 10–80× più efficiente energeticamente della CPU per singolo task, nonostante l'assorbimento istantaneo maggiore. La famiglia Gemma raggiunge la qualità più alta a precisione piena ma è marcatamente sensibile alla quantizzazione, mentre Qwen3.5 ne beneficia; Qwen3-4B-Instruct è la scelta più portabile fra i framework. La Parte 2 scompone il function calling in quattro assi causali—cardinalità del catalogo e routing pre-LLM (un pre-filtro che seleziona quali strumenti vede il modello), composizione multi-step, dominio e registro linguistico (con due ipotesi pre-registrate) e scaling intra-famiglia (Qwen3.5 da 0,8 a 9 B). Il risultato centrale, ricorrente su tutti gli assi, è l'answer-gap: un modello può selezionare lo strumento corretto con i parametri corretti e tuttavia non verbalizzare il risultato, sicché la correttezza end-to-end della chiamata—e le metriche in stile BFCL—sovrastima sistematicamente l'utilità per l'utente. Qwen3.5-4B emerge come unico agente robusto: vince al crescere del catalogo di strumenti ed è l'unico vero compositore multi-step, mentre la capacità di function calling emerge sotto i 2 B e satura a 4 B (il modello da 9 B non offre alcun guadagno misurabile). Entrambe le ipotesi pre-registrate sul dominio risultano falsificate. Oltre ai risultati empirici, la tesi contribuisce una valutazione energy-aware dei modelli piccoli su un compito manifatturiero reale, l'identificazione e la quantificazione dell'answer-gap, e un protocollo di scoring robusto—ipotesi pre-registrate, una metrica della risposta grounded e bound di sensitivity—che rende le conclusioni indipendenti dalla singola scelta di valutazione.
File allegati
File Dimensione Formato  
2026_07_Pelonzi_Executive_Summary.pdf

non accessibile

Descrizione: Executive Summary
Dimensione 459.08 kB
Formato Adobe PDF
459.08 kB Adobe PDF   Visualizza/Apri
2026_07_Pelonzi_Tesi.pdf

non accessibile

Descrizione: Tesi
Dimensione 31.73 MB
Formato Adobe PDF
31.73 MB Adobe PDF   Visualizza/Apri

I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/10589/260612