Leonardo Cofone
17 years old · Trento, Italy
I'm Leonardo. I do machine learning research, mostly on how deep models learn and how to make them cheaper. I'm 17, I live in Trento, Italy, and yes, I still have to go to high school in the mornings :(
How it started
I started programming in 2022, mostly thanks to my family. The real hook came later, from a less serious place: Jarvis, in the Avengers movies. An assistant that actually understands you looked like the coolest thing anyone could build. Then I found out about machine learning, realized people were seriously working on it, and that was it. Kind of an easy story, no tearjerker.
What I'm after
I think AI is the biggest thing humans have ever built (huge words, I know), and it's being built right now. My generation is growing up in the middle of it, with tools that were science fiction ten years ago. I don't want to live through it passively. I want to help build it and, if I'm lucky, leave a real mark on it.
A few things I try to stick to
- Serious math. Books, one after another, and never without experiments: a proof won't tell you what happens on the GPU.
- Discipline. Most days aren't exciting, and the work still has to get done.
- Check everything. A result that looks too clean is a bug until I can show it isn't. I use AI every day, and I check its work the way I'd check anyone else's, mine included.
- Mental health first, then everything else. I try to stay grateful and look at the whole path. Reaching a goal never feels the way you imagined it would, so the road had better be worth it.
Things I got wrong
- I thought AI was 100,000 nested if statements haha.
- I thought a paper was an idea plus a couple of experiments. Then I found out how many experiments it takes before you can write one sentence without overclaiming.
A normal day
School, library, work, study, training, study, sleep. Repeat.
I do triple jump: hop, step, jump. Basically a looped model with three iterations. I also play chess.
Things that help: pizza, Laufey, VS Code, a good paper (lately Exclusive Self Attention), and Understanding Analysis by Stephen Abbott, which I read for fun. Yes, I know.
I love people :) If you want to talk about any of this, write me.
Lately
Yeah, this might be a little outdated. I'm usually too busy doing the things I should be writing about. ;)
- Working on the final versions of my papers. arXiv soon, hopefully.
- My second preprint is out: Where the Loss Is Applied Shapes the Timing of Looped Language Models. Available on Zenodo, along with the code and measurements.
- Released
dsalt1.0.0 on PyPI. The optimized Python library took 227 releases to get here. Don't ask. - Joined LeadTheFuture as a mentee. Now I have a mentor to talk with about research, school choices and whatever comes next.
- Joined the Deep Models and Optimization group at MPI-IS in Tübingen as a Guest Researcher. Still one of the best experiences I've had. :)
- Joined Airpim as a Python Developer. Built a memory leak detector from scratch and validated it in production.
- ICAR-CNR gave me access to its HPC cluster to run the experiments for the next version of DSALT.
- Published the first version of my DSALT paper on Zenodo, together with the official implementation.
- Started working on my first research paper. I had a lot to learn, and probably underestimated how much there was to figure out.
- Joined EgoLog as an AI Developer, building AI agent systems and automations with n8n.
- Decided to take AI and mathematics seriously and started studying them full-time. I was hooked, and haven't really stopped since.
- Joined Top Evolutions as an AI Developer, working on AI automation for the payments industry. My first real job.
- Discovered Machine Learning (thanks Jarvis) and fell in love with it almost immediately. Started studying the mathematics behind it, classical ML, then deep learning and CNNs. Eventually, I began building end-to-end pipelines on real datasets.
- Got into Python. I loved how simple and readable it was, and started building programs of my own.
- My journey began. Wrote my first lines of code, fell in love with C++, and started exploring programming.
- I was born! I did most of the crying; everyone else did the celebrating. ;)
Research
-
Where the Loss Is Applied Shapes the Timing of Looped Language Models
Why do looped language models trained at a fixed number of loops get worse when they are run for more loops at test time? This work studies how the placement of the loss shapes the timing of their internal dynamics.
Developed during my guest research at the Max Planck Institute for Intelligent Systems, where all models were trained on the institute's compute cluster. Big thanks to Antonio Orvieto, Sajad Movahedi and Vera Milovanović for their feedback and discussions.
An earlier version is on Zenodo as “Depth-Locked Dynamics in Looped Language Models”.
-
DSALT: Sparse Attention with Adaptive Windows and Content-Selected Landmarks
Looks at how dense softmax attention degrades token representations as layers stack up, and proposes a sparse attention that combines an adaptive local window with a few landmark tokens chosen by content.
Experiments run on compute provided by ICAR-CNR, the Institute for High Performance Computing and Networking of the National Research Council of Italy.
Read more
Dense softmax attention spreads some weight over every token. Over long contexts and many layers that adds up to noise, and token embeddings start to look more and more alike.
DSALT keeps a local window around each token and adds a few landmark tokens picked from the whole sequence. The landmarks are chosen with an energy-based score that weighs how strong a token's representation is and how much it matters for the output.
The goal is to cut the token interactions that add nothing while keeping long-range dependencies, so representations get better and the computation gets cheaper. Along the way I also look at how attention structure relates to rank and to how information flows through deep networks.
Experience
-
Guest Researcher – Max Planck Institute for Intelligent Systems
Six months in the Deep Models and Optimization group, working on looped models and on making deep architectures more efficient.
I read a lot, presented my paper to the group and got feedback from people with far more experience than me. It changed how I do research.
-
Python Developer – Airpim Srl
I built a Python tool that finds memory leaks on its own, with zero dependencies, so it drops into any codebase.
The hard part was telling real leaks apart from normal allocation noise without fixed thresholds, so the tool adapts its statistics to the process it's watching. When it finds something, it walks the object graph to show what's actually holding the reference, instead of just telling you memory is growing. It was validated in production.
-
AI Developer – EgoLog Srl
I built AI agents in n8n for social media management, data enrichment, lead generation and a few other things.
All of it end to end: figuring out what the client actually needed automated, designing the agents, plugging them into the systems already in place and keeping them running once they were live.
-
AI Developer – Top Evolutions Srl
My first real job. I worked on AI automation for businesses in payments, building prompt-driven systems that matched merchants with the payment provider that actually fit them, plus some lead generation automation.
At first I trained models on the client's data, then the work moved to prompt engineering: getting the model to reason over real business constraints instead of giving recommendations that only sounded plausible.
Programs & Collaborations
-
Mentee – LeadTheFuture Mentorship
Got into LeadTheFuture, a STEM mentorship program that takes fewer than 20% of applicants. I'm paired with a mentor from the tech and research world, and we meet regularly to talk about research, school and what comes next.
-
Research Collaboration – ICAR-CNR, National Research Council of Italy
They liked the idea behind DSALT and gave me access to their HPC cluster (ICAR is the CNR's Institute for High Performance Computing and Networking), so that's where its experiments ran.
I also presented my research there and talked through recent papers and experimental results with the researchers.
Education
-
Galileo Galilei Scientific High School
Still in high school, on the scientific track, so a lot of math and science.
-
Independent study in Artificial Intelligence
Projects, online courses, competitions, books and a LOT of research papers. ;)
I probably read more papers than I drink glasses of water.
Certifications
The courses I took when I was starting out: the theory, plus hands-on work on real datasets. Click a title to see the certificate.
-
Machine Learning Specialization
Foundations of supervised and unsupervised learning with practical implementation in Python.
-
Supervised Machine Learning
Core concepts in regression, classification, and evaluation metrics.
-
Unsupervised ML, RL, Recommenders
Clustering, recommender systems, and reinforcement learning fundamentals.
-
Advanced Learning Algorithms
Neural networks, optimization, and regularization techniques.
-
Computer Vision & Image Processing
Image processing, detection, and classification using OpenCV.
-
Machine Learning Capstone
End-to-end machine learning pipeline on real-world datasets.
-
Machine Learning with Python
Model development using Python and scikit-learn.
Say hi
Questions, research ideas, collaborations, or just to tell me my attention mechanism is wrong: write me at leonardo.cofone5@gmail.com or use the form below.