Alessandro Secchi
On a mission to discover the beauty of life and to accelerate this unprecedented energy transition towards the singularity.
"Everything is energy, and that's all there is to it. Match the frequency of the reality you want, and you cannot help but get that reality."
This website aims to be a personal experiment where I'll endeavor to collect my thoughts, reflections, experiences, and passions in a diary-style format ๐.
Thoughts..
Energy
HITACHI Sustainability Award (06.02.2025, London)
I recently received the Inspiration of the Year Global Award (IYGA - section Sustainability).
A good opportunity to take a break from the usual working routine and to reflect on the meaning of sustainability in the Energy and AI transition.
๐ฑ Sustainability means electrifying everything we can, increasing the quota of renewable sources, and investing in solutions to make the grid more flexible.
๐ก HITACHI has a broad portfolio both in IT and OT which could lead this transition, using AI to increase the employee's productivity, to find synergies and new ideas in order to generate the so-called "social innovation business".
However, the direction set by most of the high-tech companies might not be the best course of action to ensure a sustainable future. That's why I have written down some general thoughts about the trajectory of this transition:
Total factor productivity growth rate โ

Measured TFP growth has slowed in many advanced economies compared to the mid-20th century. While the digital revolution has enhanced productivity, its effects are less directly visible in traditional TFP metrics than those of earlier, more disruptive innovations (electricity, motor vehicles, indoor plumbing...).
GDP growth rate โ

GDP growth has slowed in many advanced economies. Of course, this moderation reflects not only slower TFP growth but also factors like demographic trends, climate and energy crisis, and economic maturity.
Unemployment growth rate cyclical

The relationship between technological progress and unemployment is complex because it involves both job destruction and job creation, as well as broader economic and social factors. The net effect on employment depends on how well societies adapt to these changes through education, policy, and innovation.
Historically, technological progress has not led to mass unemployment. For example, the Industrial Revolution initially caused job losses in agriculture but eventually created millions of new jobs in manufacturing and services.
However, the AI revolution is something new. If AI adoption is unchecked, wealth concentration may increase, job displacement could dominate, and the natural rate of unemployment may rise permanently.
Why?
Productivity gains are no longer significantly enhancing the production function of modern economies in the way they once did. In the 1940s, innovations like electricity use empowered workers to achieve higher output by revolutionizing industrial processes. By the 2000s, computers primarily redirected labor toward new sectors (e.g., IT, digital services) rather than universally boosting productivity.
Today, AI-driven automation represents a further shift: it aims to replace human roles (e.g., computer use, operator, agents...) rather than augmenting human capabilities or creating entirely new industries. Perhaps, robotics and autonomous systems (e.g., self-driving cars, warehouse robots) will create massive new industries, but unlike past technological leaps, these sectors may not generate proportional human employment. The "big new AI industries" could profit only a few tech giants, highly profitable but labor-light.
This divergence risks a "productivity-prosperity paradox": GDP and tech corporate profits may grow, but labor's share of income could decline, reducing the "shared prosperity".
What's next?
Considering the fast pace of AI development, and the pursuit of AGI from many tech leaders, I expect to see in the next 5-10 years, an increase in GDP growth, as well as an increase in unemployment.
This might force governments to act on this AI revolution with new policies against complete automation.
That's why I'm developing and exploring the use of personal AI assistants to augment human abilities and unleash creativity for open innovation from the bottom up.
A future where computers act as "bicycles for the mind". See the picture below where the "man on a bicycle" represents the most energy-efficient form (per unit of body weight) of moving on earth. Augmentation instead of automation.

Some pictures about the awards ceremony in London:
Back from Anglogold commissioning in Tanzania (03.2024)
On my way back home, I tried to write down my reflections about the past three months in Tanzania, where we supported the partial electrification of the Geita Gold Mine.
๐๐จ๐ฆ๐ ๐๐๐๐ญ๐ฌ ๐๐๐จ๐ฎ๐ญ ๐ญ๐ก๐ ๐ฉ๐ซ๐จ๐ฃ๐๐๐ญ:
๐ญ The mine currently receives 40MW of power from 4 Wรคrtsilรค diesel generators located on-site.
๐ In 2020, the mine embarked on a grid integration project to build a 33/11kV 60MVA substation connected to the national 220/33kV grid at Mpomvu village, which will also provide power to other 130 villages in the region.
๐ก Given the complex operational requirements of the process plant and the weak grid, there is a crucial need for a reliable and secure power supply. That's why a Static Synchronous Compensator is necessary to provide dynamic voltage compensation to support the 33kV bus during grid faults and to regulate its power factor.
๐ With about 235 GWh/year of energy demand and an average CO2 emissions from the electrical grid of 0.27 kg/kwh (powered by 35% of renewable energy), this project will bring a reduction from 0,14 Mt to 0,063 Mt.
๐ธ The mine's annual energy expenditure will drastically decrease, with a NPV of 26 million, IIR 46% (over 10 years) and payback period of the investment in less than 2 years.
๐๐ข๐ง๐๐ ๐ญ๐ก๐ข๐ฌ ๐ข๐ง๐ฏ๐๐ฌ๐ญ๐ฆ๐๐ง๐ญ ๐ฌ๐๐๐ฆ๐ฌ ๐ฌ๐จ ๐๐ฉ๐ฉ๐๐๐ฅ๐ข๐ง๐ , ๐ข๐ญ ๐ฆ๐๐๐ ๐ฆ๐ ๐ฌ๐๐๐ซ๐๐ก ๐๐ฎ๐ซ๐ญ๐ก๐๐ซ:
๐ OCSE countries are accountable for 1/3 of the C02 emissions and in the last 10 years they had a yearly reduction of about 1%.
๐ฅ Global Emissions continue to rise, reaching a new record of 37.4 Gt in 2023.
๐ธ Out of $1.8 trillion of clean energy investments in 2023, developing economies account for about 15% (and they represent roughly a third of global GDP and two-thirds of the world's population).
โ๏ธ Critical minerals are pivotal for the energy transition and areas like Africa owns over 40% of global reserves.
๐๐ง ๐๐จ๐ง๐๐ฅ๐ฎ๐ฌ๐ข๐จ๐ง:
๐ข I wonder if substantial investments in the electrical grids of OCSE countries is the fastest and most effective way to addressing the global climate crisis and achieving the famous net zero emissions.
๐ข Perhaps exporting cutting-edge technology and expertise to developing countries, that are in the middle of their industrial revolution, could offer a possible answer to the "hard problem" of the energy transition.
๐ข Wouldn't it be better to reconsider (and readapt) the past approach of clean development mechanism CDM from the Kyoto protocol to valorize these investments?
...Back to my experience in Tanzania ๐น๐ฟ. The humbleness of the people I have met and their respect for nature have thought me that this energy transition might have even more relevance in those places, where nature is still part of daily life and people know how to praise it. As they told me as soon as I arrived at Mchauru Village: "Welcome back to the reality". ๐
๐ญ Investing in developing countries could be an effective way to fight global warming. However, at the same time, we should work to reduce greenhouse gas emissions per capita in places like the US and Europe, where levels are much higher than in the rest of the world.
๐๐ง๐ ๐ญ๐ก๐ข๐ฌ ๐ฆ๐ข๐ ๐ก๐ญ ๐๐ ๐๐ง ๐๐ฏ๐๐ง ๐๐ข๐ ๐ ๐๐ซ ๐ฉ๐ซ๐จ๐๐ฅ๐๐ฆ:
๐ธ Direct investments in the transmission and distribution system, as well as in the ancillary services (primary and secondary markets, capacity markets, FACTS, etc.) need a clear evaluation and communication to the citizen since it might lead to substation increase in their bills.
๐ The case of the German corridors in striking. The costs associated with transmitting high-voltage energy from wind generation in the North to consumption areas in the South amount to several tens of euros per MWh. These costs should be added to the production price at auctions (so-called "grid parity") and also include additional surcharges to maintain the quality and safety of the electrical service.
OCSE countries should take the lead in this energy transition as they can reduce the so-called green premiums by investing in new innovations.
๐ข Perhaps promoting and reviewing the concept of grid parity, which cannot solely refer to the local cost of production but must include additional costs to the electricity system. For example, nodal pricing, which redistributes some costs associated with the location and intermittency of PV production could be considered. This would foster the rise of Virtual Power Plants (VPPs), where by aggregating the interests of around a hundred households into a mini plant of a few hundred kilowatts, the cost of producing one kWh could be reduced by two-thirds (kind of car pooling but with energy โ๏ธ).
Let me know your thoughts ๐

This is an excerpt from an interview I received due to the Hitachi Sustainability Award. Here, I aim to highlight the project's positive impact on the environment and local communities and summarize some key steps I believe are important to tackle the Energy Transition. I also share a few wishes and aspirations for the people at the forefront of this transition, along with some ideas for my own professional growth.
And this is a funny video I made during my 3 months on site ๐ซ .
How to Avoid a Climate Disaster
We know that the Energy Transition is quite a complex problem, but the book "How to Avoid a Climate Disaster" helped me to grasp it in smaller and clearer solutions, which I try to summarize here:
๐ญ The world typically adds 52 billion tons of greenhouse gases to the atmosphere every year.
This includes:
- 30% from "making things" (mainly cement, steel, plastic)
- 26% from "plugging in" (electricity)
- 21% from "growing things" (plants, animals)
- 16% from "getting around" (planes. Truck, cargo ships)
- 7% from "keeping warm and cool" (heating, cooling, refrigeration)
๐ The world needs to provide more energy without releasing any greenhouse gases so the poorest can thrive.
๐ช The population growth goes down as we improve health.
โก๏ธ Electricity demand will increase also driven by new ways of making cement and plastic.
๐๐ ๐ฐ๐ ๐ฐ๐๐ง๐ญ ๐ญ๐จ ๐ฌ๐ฎ๐ฆ๐ฆ๐๐ซ๐ข๐ณ๐, ๐ญ๐ก๐ ๐ฉ๐๐ญ๐ก ๐ญ๐จ ๐ณ๐๐ซ๐จ ๐๐ฆ๐ข๐ฌ๐ฌ๐ข๐จ๐ง๐ฌ ๐๐จ๐ฎ๐ฅ๐ ๐๐:
๐ข Electrify every process possible and explore advanced biofuels and electrofuels (aim for zero-carbon cement, steel, fertilizer and plastic).
๐ข Get that electricity from clean energy sources (including next generation nuclear fission and nuclear fusion).
๐ข Use carbon capture to absorb remaining emissions (possibly directly from power plants, as some national agencies are already demanding).
๐ข Discuss and understand the impact of geoengineering (brightening clouds and injecting fine particles into the atmosphere).
๐ข Government policies to close the gap, as energy businesses spend an average of 0.3% on R&D compared to the 10% of IT and pharma industries.
๐ข Adopt more F-gases-free coolants
๐๐ฅ๐ฅ ๐ญ๐ก๐๐ฌ๐ ๐ฉ๐จ๐ข๐ง๐ญ๐ฌ ๐๐๐ฉ๐๐ง๐ ๐จ๐ง ๐ ๐ฌ๐ข๐ง๐ ๐ฅ๐ ๐๐๐๐ญ: ๐ฅ๐จ๐ฐ๐๐ซ ๐ญ๐ก๐ ๐ ๐ซ๐๐๐ง ๐ฉ๐ซ๐๐ฆ๐ข๐ฎ๐ฆ๐ฌ.
๐๐ก๐๐ญ'๐ฌ ๐ฐ๐ก๐ฒ ๐๐๐๐ ๐๐จ๐ฎ๐ง๐ญ๐ซ๐ข๐๐ฌ ๐ฌ๐ก๐จ๐ฎ๐ฅ๐ ๐ญ๐๐ค๐ ๐ญ๐ก๐ ๐ฅ๐๐๐ ๐ข๐ง ๐ญ๐ก๐ข๐ฌ ๐๐ง๐๐ซ๐ ๐ฒ ๐ญ๐ซ๐๐ง๐ฌ๐ข๐ญ๐ข๐จ๐ง ๐๐ฌ ๐ญ๐ก๐๐ฒ ๐๐๐ง ๐ซ๐๐๐ฎ๐๐ ๐ญ๐ก๐ข๐ฌ ๐๐ข๐๐๐๐ซ๐๐ง๐๐ ๐๐๐ญ๐ฐ๐๐๐ง ๐๐ฎ๐ซ๐ซ๐๐ง๐ญ ๐ฌ๐จ๐ฅ๐ฎ๐ญ๐ข๐จ๐ง๐ฌ ๐๐ง๐ ๐ญ๐ก๐๐ข๐ซ ๐๐ฅ๐๐๐ง ๐๐ฅ๐ญ๐๐ซ๐ง๐๐ญ๐ข๐ฏ๐๐ฌ ๐๐ฒ ๐ข๐ง๐ฏ๐๐ฌ๐ญ๐ข๐ง๐ ๐ข๐ง ๐ง๐๐ฐ ๐ข๐ง๐ง๐จ๐ฏ๐๐ญ๐ข๐จ๐ง๐ฌ.
Let me know your thoughts ๐

AI
AI, LLM and Energy (07.2024)
A few months ago, I wanted to start some AI projects to better understand its potential and see if it could really assist me.
1) Regarding foundation models (LLMs), nearly every week, there was an announcement about new, more powerful models from different companies. Sorting them out was quite straightforward:
๐ Open-source models (>70B parameters):
Llama (Meta) vs. Grok (xAI from Elon) vs. Mistral AI (largest European LLM) vs. Falcon (Abu Dhabi TII)
๐ Private models (>70B parameters):
GPT (OpenAI/Microsoft) vs. Gemini (Google) vs. paLM (Google) vs. Claude (Anthropic) vs. Olympus (Amazon) vs. Ernie (Baidu, Inc. - China).
2) Then I started to look into open-source models that allow me to customize my application and maybe run it on my local machine.
๐ปSo, I began exploring LLMs that can run locally, using tools like: LMStudio vs. Ollama vs. GPT4All.Of course, my laptop can only handle LLMs with <7B parameters, but for initial experiments, I thought this would be more than enough.
3) The next step was to look for basic LLM frameworks and repositories from this new AI world:
โ From Langchain and LlamaIndex (for Python and JavaScript) to Relevance AI and Make.com (for low-code solutions).As a good starting point, I decided to explore some pre-built open-source projects and here, I was astonished by the thousands of open-source projects publicly shared every day on GitHub and Hugging Face (the GitHub for LLMs).
4) Among them, I tried:
AutoGPT (linked with OpenAI) vs. HuggingGPT (integrated with models from Hugging Face) vs. AutoGen (a multi-agent project that supports function calling to extend the capabilities of the model by generating documents, sending emails, etc.).Testing these projects was inspiring, but I must be honest. They are still prototypes with bugs that require new daily releases.
Naturally, their closed-source counterparts are more reliable:
Azure AI Studio (a Microsoft integrated environment to develop AI agents) vs. Microsoft 365 Copilot (quite useful with Excel and Outlook) vs. OpenAI GPTs (arguably the most utilized AI playground).It's also worth mentioning AI Image and Video Generation models (DALL-E 3, Midjourney, Stable Diffusion, Sora, Runway). See the breakthrough experiment from Reid Hoffman.
5) Finally, I opted for an AI open-source IDE that allowed me to develop and connect objects (nodes and graphs). Tools like Flowwise, Langlow, but especially Rivet, are great for visualizing and building complex chains and create production-ready applications.
๐๐จ๐ฆ๐ ๐๐ข๐ง๐๐ฅ ๐ซ๐๐๐ฅ๐๐๐ญ๐ข๐จ๐ง๐ฌ ๐๐ซ๐จ๐ฆ ๐ญ๐ก๐ข๐ฌ ๐๐ ๐ฃ๐จ๐ฎ๐ซ๐ง๐๐ฒ:
๐ข As of today, I don't see disruptive ideas from these AI models that could significantly change my daily life or a7
traditional company's business.
However, there is a remarkable boost in R&D and academic activities, and a huge benefit for developers who can use AI copilots to build their software or create simple websites (https://secchialessandro.github.io/).
For a company business, it would be interesting to explore solutions such as Azure AI Studio with some open source LLMs models.
๐ข We are moving towards highly specialized small agents in a multi-agent and multimodal frameworks. The new GPT-4o just leaves space to the imagination ๐คฏ.
๐ข It is worth to mention the so called large action model "LAM" (see Rabbit r1). Check out the new open source project from Microsoft "Visualization-of-Thought (VoT) Elicits Spatial Reasoning in Large Language Models".
๐ข If you aim to use open-source LLMs, maintain the privacy of your data, and run useful applications, you could do so from your own laptop (with limited complexity) or from an internal server if you're a business.
๐ I am convinced that we are getting closer and closer and I will spend some time to seek for opportunities between this new AI world and my passion in Energy.
Some friends have already introduced new methods to operate in the electricity market. For instance, Matteo Pisani developed a model to regulate the voltage from a load tap changer using reinforcement learning algorithms (reducing unnecessary tap movements, thus maintenance costs of the device).
"๐๐ฐ๐ธ๐ข๐ณ๐ฅ ๐ด๐ช๐ฏ๐จ๐ถ๐ญ๐ข๐ณ๐ช๐ต๐บ, ๐ต๐ฉ๐ณ๐ฐ๐ถ๐จ๐ฉ ๐ต๐ฉ๐ฆ ๐ฆ๐ฏ๐ฆ๐ณ๐จ๐บ ๐ต๐ณ๐ข๐ฏ๐ด๐ช๐ต๐ช๐ฐ๐ฏ."

Hitachi Lumada AI (08.2024)
More frequently, I hear talk about highly specialized small agents in a multi-agent frameworks.
CrewAI, LangGraph, MetaGPT, LlamaIndex, Autogen are the most famous ones used in interesting application such as:
๐จ Automating the process of checking new emails and creating drafts based on internal know-how.
๐จโ๐ผ Replicating the structure of a software company (each agent is trained on their job profile), where from a single line requirement as input, it outputs competitive analysis, data structures, APIs, documents, software repository (see Pythagora ๐คฏ)..
Working at one of the Hitachi companies, gave me the inspiration to build a multiagent framework to exploit the huge amount of knowledge in information technology (IT) business as well as the operational technology (OT), a special combination that only a few companies can afford.
Therefore, by looking at the Lumada concept, I tried to build an application with LangGraph, where each agent is trained on the respective company data (scraped from the website section: products and solutions)
and the supervisor (LumadaAI) can choose a specific agent (company) to perform the RAG (retrieval augmented generation) on the training data.
In addition, I have added two agents called "Researcher" and "Coder" to perform a general web search and basic data analysis calculations.
In this framework, each agent is a node in the graph, and their connections are represented as an edge. The control flow is managed by edges, and they communicate by adding to the graph's state.
With LangGraph I could create a cyclical and non-linear workflows where the agents can revisit and refine their actions based on new data, leading to more accurate and efficient outcomes.
Specialization, collaboration, flexibility and scalability are the main advantages of this kind of multi-agent systems.
This is a basic prototype and many improvements are possible:
- Improve the RAG code with a self-corrective logic (which incorporates self-reflection / self-grading on retrieved documents)
- Increase the number and quality of training data
- Add an agent trained on the customer's data
- Improve the quality of the user prompt

In the example below, I asked LumadaAI to support me in the planning, building, operating and maintaining of a new hospital.
The tool is retrieving information from Hitachi Energy, Hitachi Astemo, Hitachi HighTech, Hitachi Rail, Hitachi Construction Machinery and GlobalLogic.
๐ข I believe this kind of application can enhance the general human creativity and support many jobs by reducing the complexity of the problem, combining a huge amount of data, to come up with new products and solutions.
"๐๐ฐ๐ช๐ฏ๐ฆ๐ฅ ๐ง๐ณ๐ฐ๐ฎ ๐ต๐ฉ๐ฆ ๐ธ๐ฐ๐ณ๐ฅ๐ด "๐ช๐ญ๐ญ๐ถ๐ฎ๐ช๐ฏ๐ข๐ต๐ฆ" ๐ข๐ฏ๐ฅ "๐ฅ๐ข๐ต๐ข", ๐ต๐ฉ๐ฆ ๐ฏ๐ข๐ฎ๐ฆ ๐๐ถ๐ฎ๐ข๐ฅ๐ข ๐ฆ๐ฎ๐ฃ๐ฐ๐ฅ๐ช๐ฆ๐ด ๐ฐ๐ถ๐ณ ๐จ๐ฐ๐ข๐ญ ๐ฐ๐ง ๐ด๐ฉ๐ช๐ฏ๐ช๐ฏ๐จ ๐ข ๐ญ๐ช๐จ๐ฉ๐ต ๐ฐ๐ฏ ๐ฐ๐ถ๐ณ ๐ค๐ถ๐ด๐ต๐ฐ๐ฎ๐ฆ๐ณ๐ด' ๐ฅ๐ข๐ต๐ข ๐ข๐ฏ๐ฅ ๐ช๐ญ๐ญ๐ถ๐ฎ๐ช๐ฏ๐ข๐ต๐ช๐ฏ๐จ ๐ช๐ต ๐ช๐ฏ ๐ด๐ถ๐ค๐ฉ ๐ข ๐ธ๐ข๐บ ๐ต๐ฉ๐ข๐ต ๐ธ๐ฆ ๐ค๐ข๐ฏ ๐ฆ๐น๐ต๐ณ๐ข๐ค๐ต ๐ฏ๐ฆ๐ธ ๐ช๐ฏ๐ด๐ช๐จ๐ฉ๐ต, ๐ต๐ฉ๐ฆ๐ณ๐ฆ๐ฃ๐บ ๐ณ๐ฆ๐ด๐ฐ๐ญ๐ท๐ช๐ฏ๐จ ๐ฐ๐ถ๐ณ ๐ค๐ถ๐ด๐ต๐ฐ๐ฎ๐ฆ๐ณ๐ด' ๐ฃ๐ถ๐ด๐ช๐ฏ๐ฆ๐ด๐ด ๐ช๐ด๐ด๐ถ๐ฆ๐ด ๐ข๐ฏ๐ฅ ๐ค๐ฐ๐ฏ๐ต๐ณ๐ช๐ฃ๐ถ๐ต๐ช๐ฏ๐จ ๐ต๐ฐ ๐ต๐ฉ๐ฆ๐ช๐ณ ๐ฃ๐ถ๐ด๐ช๐ฏ๐ฆ๐ด๐ด ๐จ๐ณ๐ฐ๐ธ๐ต๐ฉ."
"๐๐ฐ๐ธ๐ข๐ณ๐ฅ ๐ด๐ช๐ฏ๐จ๐ถ๐ญ๐ข๐ณ๐ช๐ต๐บ, ๐ต๐ฉ๐ณ๐ฐ๐ถ๐จ๐ฉ ๐ต๐ฉ๐ฆ ๐ฆ๐ฏ๐ฆ๐ณ๐จ๐บ ๐ต๐ณ๐ข๐ฏ๐ด๐ช๐ต๐ช๐ฐ๐ฏ."
Role-based reasoning to Find the Right Company and Generate Clause-by-Clause Reports for Tenders ๐๏ธ
Gemini 1.5 introduced a major breakthrough in AI with its notably large context window. It can process up to 2 million tokens at once vs. the typical 32,000 - 128,000 tokens. This is equivalent to being able to remember roughly 100,000 lines of code, 10 years of text messages, or 16 average English novels ๐คฏ.
With large context windows, methods like vector databases and RAG (that were built to overcome short context windows) become less important, and more direct methods such as in-context retrieval become viable instead. Likewise, methods like many-shot prompting, where models are provided with hundreds or thousands of examples of a task as either a replacement or a supplement for fine-tuning, also become possible.
That's why I've decided to partecipate with a friend to the "Google - Gemini long context" competition by building a public Kaggle Notebook and YouTube Videos that demonstrate a creative and usefull use case.
We decided to use the long context window to find the best company that fit your techcnical and commercial tender requirements ๐.
- A tender is a formal process, where organizations or companies invite suppliers, contractors, or service providers to submit proposals or bids to deliver a specified project, product, or service.
- A clause-by-clause is a detailed examination of this tender, that highlights the compliant and not-compliant requirements with respect to the company offer.
As this process is carried out in most of the companies and it is quite time-consuming, we believe that the Gemini's long context window introduces a novelty in this business process:
- It analyzes long technical and commercial tenders for a project.
- It assesses the compatibility of companies' products and services with tender documents.
- It finds the best company and product-service combination to execute your project, generating a clause-by-clause report with compliant and non-compliant specifications.
Notebook Structure ๐
The notebook is available in Kaggle: The Perfect Match for Your Tech and Business Needs and it is divided into different sections, each with a specific objective:
- Dataset load
- Tenders for a project are parsed, converting their information into text.
- Information scraped from various companies' websites is loaded as text.
- All text is processed by Gemini using different prompts, combining role-based reasoning, chain of thoughts, Gemini API context caching feature, and in-chat memory.
The long context window acts as a shared workspace, recording and making all user prompt outputs accessible for seamless and holistic reasoning. In today's interconnected world, where partnerships and synergies are essential to addressing complex challenges, I think we need to create a tool that enables continuous reasoning, uncovers new patterns and solutions, and minimizes the fragmentation of insights.๐ก
MACHINE LEARNING / AI NOTES (ETH 10.2024)
Feed Forward Networks โก
One key concept is the so-called universal approximation property, which already holds for shallow neural networks with arbitrary width, consisting of an input layer, one hidden layer, and an output layer..
Indeed, at the end of the eighties, it was proved by George Cybenko that neural networks with only one hidden layer and bounded sigmoidal activation functions (i.e., limx โ โฯ(x) โ 1 and limx โ โโฯ(x) โ can approximate generic classes of functions.
Kurt Hornik showed in 1991 that it is not the specific choice of the activation function that leads to the universal approximation property, but that it works for generic continuous non-polynomial functions.
CNN vs. Standard Feed Forward Networks ๐ฅ๏ธ
A CNN (Convolutional Neural Network) differs from a standard feed forward neural network by the structure of hidden layers.
- The hidden layers of a CNN typically consist of a series of convolutional layers.
- The word convolution is rather a convention, coming from the replacement of the matrix vector product by a sort of convolution. Mathematically, it is actually a sliding dot product.
Recurrent Neural Networks (RNNs) ๐
RNNs are a class of artificial neural networks for sequential data processing. They exhibit a temporal dynamic behavior where new inputs can enter, making them well-adapted for modeling and processing:
- Text
- Speech
- Time series
Hopfield Networks are a type of recurrent neural network.
Reinforcement Learning (RL) ๐น๏ธ
Reinforcement Learning maximizes the notion of cumulative reward. It is one of three basic machine learning paradigms, alongside:
- Supervised Learning: Develop models to map input and output data (i.e., regression or classification).
- Unsupervised Learning: Process and interpret data based only on the input (i.e., clustering).
For a given training data set (xi, yi, i = 1, ..., M), supervised learning means to find the parameters ฮธ of a neural network such that a given loss function L is minimized.
Optimization Challenge
But how to deal with a non-linear, non-convex optimization problem with millions of parameters?
With stochastic gradient descent where the gradient is replaced by an unbiased estimator.
The parameters of the network are randomly initialized and trained by self-play reinforcement learning. You select moves by Monte Carlo tree search, which gives โ based on simulated games โ probabilities ฯ for the possible moves and game outcome z.
The network parameters are trained to:
- Maximize the similarity of p (move probabilities) and ฯ
- Minimize the error between the predicted outcome v and the game outcome z, i.e., the loss function L.
- Reward r: The agent's possibility to maximize the reward over time.
- State X: Represents the environment. U is the action space.
- History: Considered in state x โ Markov state.
- If the agent can directly measure the full environment state, then it is called a Markov Decision Process (MDP).
- Policy ฯ: The agent's internal strategy for picking actions.
- State value function (v-function): The expected return of being in state x following policy ฯ.
- Action value function (q-function): The expected return of being in state xk, taking action uk, and following policy ฯ.
So, the objective is to estimate the v function and q function.
Model-Based vs. Model-Free RL
- Model-Based RL: When the model for the environment and reward function is known (e.g., a Markovian model to predict what happens inside the environment).
- Model-Free RL: When model dynamics and rewards are unknown to the agent. The goal is to find the optimal policy while learning the model and rewards (with exploration and exploitation).
Typical methods involve Discrete Time Finite Markov Decision Processes (MDP).


P is the state transition probability matrix.
- In simple terms: v*(x) tells the agent how much reward it can expect if it starts in state x and always makes the best choices afterward.
- In simple terms: q*(x, u) tells the agent how much reward it can expect if it starts in state x, takes action u, and then makes the best decisions afterward.

Considering that:
- An optimal policy must deliver the maximum expected return being in a given state.

So the equations can be rewritten as follows:


- If the environment is exactly known, solving for v* or q* directly delivers the optimal policy. Once the values are known, the optimal policy can be derived by always choosing the action that maximizes these values.
- Otherwise, in model-free scenarios, use value iteration algorithms (e.g., Q-learning or neural fitted Q-learning or deep policy-based algorithms).
Q-Learning
The agent explores the environment, tries different actions, and updates its q(x, u) values using this formula:

In Neural Fitted Q-Learning: Instead of maintaining a table of q-values for each state-action pair (which can be huge in complex environments), a neural network is trained to predict these values.
- Collect data first in an "experience replay buffer."
- Then train from the target neural network, get the loss function, and backpropagate to train the actual Q network.
Deep Policy-Based Algorithms
- Policy-based algorithms directly learn the policy (the best actions) instead of learning the v* or q* functions first.
- The agent uses a neural network to directly map states to actions, optimizing the policy to maximize rewards. ๐
Generative AI
Generative AI is typically powered by deep neural networks, especially transformer architectures, which excel at processing large datasets and understanding complex patterns.
Step-by-Step Through the Transformer with "Cat" ๐ฑ
1. Input Embedding and Positional Encoding- Each word in the sentence "The cat sits" is first converted into an embedding vector. For example, the word "cat" could be transformed into a vector like: [1.2, -0.8, 0.6, โฆ]
- Then, positional encoding is added to this vector to capture the position of "cat" in the sentence. After adding positional encoding, "cat"'s vector might look like: Embedding + PosEnc = [1.4, -0.7, 0.5, โฆ]
- Generate the Query (Q), Key (K), and Value (V) vectors for each word. For "cat," let's say:
- Qcat = [0.2, -0.3, 0.5, โฆ]
- Kcat = [0.1, -0.4, 0.7, โฆ]
- Vcat = [0.3, 0.2, -0.6, โฆ]
- Calculate the attention score for "cat" in relation to other words in the sentence using the dot product of Qcat with each word's Key vector:
- Scorecat, the = (Qcat โ Kthe) / โdk
- Scorecat, cat = (Qcat โ Kcat) / โdk
- Scorecat, sits = (Qcat โ Ksits) / โdk
- Apply Softmax to the scores to get attention weights, indicating how much "cat" should "focus" on each word. Suppose the results are: Weightscat = [0.1, 0.8, 0.1]
- The attention output for "cat" is a weighted sum of Value vectors: Attention Outputcat = (0.1 โ Vthe) + (0.8 โ Vcat) + (0.1 โ Vsits)
- With multiple heads, "cat" has different sets of Q, K, and V vectors per head, capturing various semantic aspects. Outputs from each head are concatenated and transformed to merge back together.
- The attention output for "cat" passes through a feed-forward network to add complexity: FFNcat = ReLU(W1 โ Attention Outputcat + b1) W2 + b2
- A residual connection and layer normalization are applied: Outputcat = LayerNorm(Embeddingcat + FFNcat)
After multiple layers, "cat" will be represented as a vector that captures its meaning in the sentence "The cat sits." This final vector is used for the next steps, like classification or generation. Each layer helps the model build richer contextual understanding, making "cat" aware of its relationship to "sits" and "the" based on the surrounding words and overall sentence meaning.
Training Objective ๐ฏFor language models, the common training objective is to minimize the cross-entropy loss between the predicted sequence and the actual sequence.
ML in Robotics
Machine Learning (ML) plays a crucial role in robotics, bringing more flexibility and adaptability to robotic systems. Let's break down some core components of ML in robotics, including key concepts, challenges, and potential future directions.
๐ Formulate
- Predicting or identifying patterns in data to understand and improve robotic functions.
๐ Formalize
- Representation: Choose models that represent data patterns well, such as:
- Linear regression
- Random forests
- Neural networks
- Evaluation: Measure model performance to ensure its effectiveness in tasks.
- Optimization: Maximize the model's performance on the data given for the best outcomes.
๐ Deploy
- MLOps: Establish robust machine learning operations to ensure efficient deployment, monitoring, and scaling of models in robotics.
๐ค Control Strategies in Robotics
Classical Control
Breaks down the problem into planning and control phases, simplifying robotic task management.
Reinforcement Learning (RL)
Directly optimizes task-level objectives and leverages domain randomization to cope with model uncertainty. This allows the system to discover more robust control responses for better task handling.
End-to-End Learning Control
Integrates all steps seamlessly:
Sensors โ Perception (learning) โ Planning (learning from data) โ Control (learning)
๐ง Advanced Learning Techniques
- Optimal Control: Focuses on finding the best control policy for the robot.
- Imitation Learning: Observe an expert and imitate their actions, such as observing the status of a mobile "Aloha" system.
- Privileged Imitation Learning: Uses expert knowledge for more efficient learning.
Policies
Explicit, Implicit, and Diffusion Policies: Different methods of defining the robot's behavior policy.
Kalman Filter
A mathematical method to estimate the internal state of a process, aiding robots in tracking and estimation tasks.
RL Approaches
- Model-free vs. Model-based RL: Model-free relies on trial and error, while model-based uses a model of the environment.
- Inverse RL: Learn the reward function by observing an expert. Once learned, it uses RL to create a policy based on that reward function.
๐ค Challenges in Building Generalist Robots
- Unstructured and unpredictable environments
- Generalization across embodiments โ requires versatile hardware
- Contextual understanding and high-level reasoning
- Multi-tasking and priority balancing โ goals and targets can be hard to specify
- Regulatory, safety, and cost-related concerns
- Limited robotic data, unlike the abundant web-scale text and image data
- Constraints of current hardware and simulators
- Requirement of dynamic models โ many scenarios are hard to model accurately
Enhancing Robot Perception with AI
Vision-Language Models
For advanced robot perception, merging vision and language.
Language-Conditioned Imitation Learning
Enables robots to imitate tasks based on language instructions.
Future Directions in Robotics Control
Hybrid Control Strategies
A hybrid control strategy leverages both a model predictive controller and a learned policy for optimal robotic control and adaptability.
๐ค Robot Morphology
Exploring which morphologies (structural designs) are best suited for specific tasks and environments.
With advancements in ML and AI, robotics continues to move towards creating versatile, intelligent systems that can operate reliably across diverse scenarios and environments.
๐ Check Out My Project on Hugging Face
I tried to solve a classical project in ML involving the LunarLander environment using the Proximal Policy Optimization (PPO) algorithm. In this task, an AI agent is trained to control a spacecraft and land it accurately on a lunar surface, all while managing its limited fuel and avoiding obstacles.
๐ You can view my project and try it out on Hugging Face: ppo-LunarLander-Ale
Ethics of AI: Fairness, Trust, Trustworthiness, Transparency
In the development of AI, ethics play a crucial role in guiding the values and principles that underpin AI systems. Key concepts in this area include Fairness, Trust, Trustworthiness, and Transparency, all of which are essential for building AI that respects human rights and societal norms.
๐ Ethics, Trustworthy AI, and Responsible AI
- Ethics of AI: Defines the values we aim to uphold through AI systems, ensuring they align with human values and rights.
- Trustworthy AI: Guarantees that these ethical values are technically implemented and respected throughout the system.
- Responsible AI: Governs and enforces the ethical and trustworthy design, ensuring consistent application in real-world scenarios.
๐ Main AI Regulations
- 2019 โ Ethics Guidelines for Trustworthy AI: A foundational document outlining core ethical principles in AI.
- The European Union AI Act: A regulatory framework focused on ensuring AI systems meet strict ethical and technical standards.
๐ Transparency in AI
Transparency is a key aspect of ethical AI, helping users understand and trust AI systems. It includes three major components:
- Traceability of Processes: Keeping a record of all decisions and actions taken by AI systems, which helps track and understand their behavior.
- Explainability of Machine Learning Models: Providing clear explanations of how AI models reach their conclusions, making the decision-making process more u
Helpful Scripts for these notes
๐ Check out my GitHub: LLM_Basics
๐ Repository Contents:- Experimental_Agents_ETH.ipynb
- Finetuning_ETH_Basics.ipynb
- Neural_Networks_ETH.ipynb
- Prompt_Engineer_ETH_Basics.ipynb
- RAG_ETH_Basics.ipynb
- Supervised_Learning_ETH.ipynb
Leadership
Leadership, Motivation, Inspiration
"The most beautiful experience we can have is the mysterious. It is the fundamental emotion that stands at the cradle of true art and true science. He to whom this emotion is a stranger, who can no longer wonder and stand rapt in awe, is as good as dead: his eyes are closed."
Over the past month, I've been reminded of the importance of certain emotions: inspiration and motivation, which are fundamental drivers for uncovering life's mysteries and fostering innovation. Some events, have triggered few reflections that I'd like to write down to better organize my thoughts.
Once I've read that the last metamorphosis of the spirit is represented by the "child", as a symbol of creativity, spontaneity, playfulness and openness. At this stage, we begin to wonder about everything again but with a fresh perspective. What are the unresolved mysteries of life? Which goals can we set for ourself? How can we inspire others?..
"He who has a why to live can bear almost any how."
Thus, we start exploring different aspects of life, trying to push beyond apparent limitations. We live multiple stories, encounter new cultures, begin new studies - driven by the desire to fill a void or bridge a gap.
We shall be always careful to use knowledge as a means, rather than pursuing it for its own sake. Knowledge should be disinterested, not driven by a "will to power," as it can sometimes disconnect from the more vital, instinctual aspects of life - passion, love, and creativity.
But how can we sustain these important aspects of life?
Needs can evolve into drives, which may result in motivation. In other words, to maintain motivation, we must leave some needs unfulfilled at all times.

The goal - at least for me - is to remain in the state of self-actualization: what I can be, I must be. I don't want to stray too far, but this state acknowledges the concept of linking justice to virtue (Aristotelism). Society should not just aim to maximize welfare (utilitarianism) or respect individual rights (libertarianism); it should also promote the moral character of individuals.
I like the Maslow pyramid, as it highlights the importance of professional development and equal opportunities.
Finally, a list of some quotes that often come to mind when it's about being inspired. They may seem a bit trivial or loosely connected, but I believe they serve as valuable fuel for finding certain answers:
- I think it's possible for ordinary people to choose to be extraordinary.
- Your time is limited, so don't waste it living someone else's life.
- Everything around you that you call life was created by people no smarter than you, and you can influence it.
- I think it's very important to have a feedback loop, where you're constantly thinking about what you've done and how you could be doing it better (togheter).
- The greater the risk, the greater the reward.
- People don't buy what you do; they buy why you do it.
- It's not important which company you work for, but which leader.
- Most people don't get experiences because they never ask.
- If you haven't found the right friend or partner you are looking for, it is just because you haven't talked enough with different people.
- What you do with your day, is how you live your life.
I want to close this train of thoughts with a reflection from one of the last books I read: Outliers: The Story of Success.
Success is a story of people who were given a special opportunity to work really hard and seized it, and who happen to come of age at a time when that extraordinary effort was rewarded by the rest of society. It is a product of history and community, of opportunity and legacy of the world in which we grew up. We need to be aware of all these variables so as to replace the arbitrary advantages with a society that provides opportunities for all.
Here are some of the sources of inspiration I mentioned earlier:
- The kickoff of my studies in management, economics and energy policy.
- Training sessions for Hitachi Energy with the service engineers from around the world in Switzerland.
- A volleyball weekend training event with team-building activities.
Experience
Control Software Engineer
As a power electronics engineer, I typically deal with medium power converters for different applications (Rail, distribution grids, mines, offshore platforms..).
It's a cool job as it allows to take many resposabilities.
At times, I see our unit as a start-up with a hundred years of expertise.
We are about 20 control software engineers, fortunate to be deeply engaged in the whole design of these medium-power converters,
including sales support, electrical design, software development, on-site commissioning and service.
But the most interesting part is that, our solutions are evolving projects following market and customer requirements. So, we
are actually part of this Energy Transition! ๐๐ฟ
So far, I have worked on different projects:
- Anglogld STATCOM, which will contribute to the electrification of the Geita Gold Mine in Tanzania, Africa.
- WPD Western Power Distribution STATCOM, UK.
- Draugen STATCOM for offshore platform, Norway.
- Other Static Frequency Converters (SFC) for Rail projects.
The software that we commonly used are: Matlab/Simulink, Compact Control Builder (CCB), Python (automated framework)..
R&D Electrical Engineer
I worked as an R&D engineer at the automotive division of Schaffner Group. There, I designed and assembled an Electromagnetic Interference (EMI) filter for an electric hypercar ๐๏ธ.
I had the privilege to experience the main phases of the product development before its mass production (design simulations, prototyping, testing and validation).
I was also lucky that my manager taught me the importance of leadership.. ("๐ฐ๐ ๐๐ ๐๐๐ ๐๐๐๐๐๐๐๐๐ ๐๐๐๐๐ ๐๐๐๐๐๐๐ ๐๐๐ ๐๐๐๐๐๐, ๐๐๐ ๐๐๐๐๐ ๐๐๐๐
๐๐").
After some months, the company invited me to develop a theoretical model to predict the conductive emissions within an automotive powertrain. This novel strategy was capable of simulating the common and differential mode spectrum in just a few seconds โก.
The main software I used at that time was LTspice for the electric circuit simulation, FEMM for core magnetic simulations, Altium for the PCB design, and other instruments such as the vector network analyzer and the impedance analyzer.
July 2021 - September 2021
Co-Founder
During the Covid period, I spent a lot of time in my room, but it was also a time when I met many interesting new people.
In fact, I became a passionate YouTube host, organizing webinars dedicated to the energy and automotive sectors.
With our student association (EMS), we successfully engaged top industries and universities, attracting over 2000 live viewers.
We had insightful discussions about the European Green Deal and hydrogen with experts like Guido Bortoni and Alessandro Clerici.
Additionally, we hosted inspiring talks with representatives from the Stellantis Group, Tesla Owners, ENEA, FAST, WEC Italy, RSE, AEIT, and ABB.
Here the Youtube channel (Italian).
Check it up!
Studies
ETH Zurich
The MAS ETH MTEC is a management degree offered by ETH Zurich. It is an interdisciplinary program similar to an MBA, targeted at engineers with a few years of leadership experience.
Core courses in:
- Strategic Management and Governance
- Micro/Macro Economics with focus on Energy Economics and Policy
- Financial Management, Accounting
- Entrepreneurship Leadership
Silicon Valley Study Tour
Networking events, company visits (Meta, Google, Apple, Cisco,Synopsys, Stanford, Pinterest, Capgemini, Uniphore) and Q&A sessions throughout the innovation ecosystem of the Bay Area, CA.
๐ก Inspiring and insightful opportunity to understand the mindset among the entrepreneurs of Silicon Valley.
After the tour, I embarked on a solo trip to Los Angeles, Las Vegas, the Grand Canyon, and New York.
Those months have been truly memorable, both personally and professionaly. I guess I will write some reflections
about that genuine ambition I have experienced in SF, maybe with some thoughts about AI and Energy ๐.
Politecnico di Milano
Main Courses in Power Electronics, Electric Power Systems, Electric Propulsion, Electrical Switching Devices, Electricity Market, Electromagnetic Compatibility.
Extra Courses in Bayesian Statistics, Project Management, Autonomous Vehicles, Quantum Physics.
Grade: 110 Summa cum laude (4 GPA) ๐๐ค.
Main Projects available on GitHub: (forgive me, it's a bit messy since I have used it merely as a repository than version control)
- High-frequency modeling of an automotive powertrain for optimal EMI filter design (Master Thesis)
- Current sensor in current divider configuration for extended measurement range (Bachelor Thesis)
- Simulation of a DC motor drive for a Tram with a reference speed profile
- Field-Oriented Control of an induction motor of a train
- Direct Torque Control for a Formula E car
- AC Brushless control for Alfa Romeo induction motor
- Electrical and thermal model for a slow and fast battery charge and driving cycle of an electric vehicle
- Optimal solution to mitigate the contingencies (Correctable Emergency State) with a power Flow Analysis on Medium-Sized Systems. Focus on the effects of changes in generator, transformer, and shunt capacitor controls as well as of contingencies on the system bus voltages and transmission line flows
- Transient stability simulation software to determine critical clearing times, to look at the impact of generator losses on system frequency and to consider methods to prevent short-term voltage collapse
- Arc energy, Joule Energy, and actual (limited) current peak in the interruption of a resistive and inductive AC circuit by a limiting circuit breaker
- Bayesian learning and Monte Carlo simulation of the dataset "Ames House Price"
- Design of a residential PV plant with an energy storage system and its management strategy. Technical and economical study
- Financial analysis of the TuNur's project: the first large utility-scale solar export project exploiting the technology of concentrated solar panels
Software: Matlab/Simulink, Femm, LTspice, R, PowerWorld, Python.
Languages: Italian (mother tongue), English (fluent C1), German (basic).
Tsinghua University
Experiencing the emerging technology in the green transformation of
China and its environmental issues through lectures, targeted field trips,
and transcultural teamwork โป๏ธ. Final presentation about CO2 capture reuse.
There is a lot to say about this experience and my connection with China..
I guess you can see it from my side projects. Anyway, sooner or later I will write some thoughts about this too.
Technical School
Electrical specialization, final grade: 100/100.
Thesis: "Turbocor TT300 - An Examination of an Oil-Free Magnetic Bearing Centrifugal Compressor at Bormio Thermal Springs." This thesis
delved into the comprehensive electrical and hydraulic system analysis of the thermal resort in my hometown ๐.
The insights about those thermal baths that I got thanks to my father are invaluable. This thesis is for him ๐จโ๐ซ.
Also, during my studies, I spent five years at the Salesian Boarding School. Memorable years and still great sense of belonging thanks to the people I have met.
Side Projects
Siemens Digital Academy
Workshops and insights from "Casa Siemens" in Milan. We worked on the digital substation business, configuring the overcurrent Siprotec 7SJ85 protection,
testing its digital twin and sending the data to the cloud (Mindsphere) via RTU (SICAM A8000).
Really good atmosphere from Siemens' Milan environment.
Hackathons
I've always had a keen interest in the startup world, constantly exploring ways to be creative and seek out disruptive ideas. That's why I enjoyed the time spent with my geek friends during these hackathons We also managed to get good results! ๐
- Winning the first prize at the Bosch #Restart hackathon for presenting an innovative system tailored for restaurants and bars. Video Spot and Presentation.
- First prize at the Campus Party Italy hackathon by designing a prototype of smart glasses equipped with augmented reality and face recognition technology. These glasses can potentially assist recruiters or sales managers in identifying targeted individuals. Video Spot and Press.
- Collaborating with two developers and institutional partners to create a mobile app for the mountain lodge "SunnyValley." This app provides users with optimal routes for hiking, cycling, and ski touring based on seasonal conditions, utilizing GPS tracking. The app is available on the Google Play Store and Apple App Store. Play Store and Video Spot.
Students' representative
As a representative for students at Politecnico di Milano's Electrical Engineering department and during my time in high school, I focused on enhancing the department appeal and organizing innovative events for 400+ students with local media coverage.
ITIS' got talent is worth mentioning. It has been the first institute assembly attended by all students since many years ๐ซ. We introduced innovative ways of interaction where many people could show their talents.
Intercultural exchanges
"The most beautiful experience we can have is the mysterious. It is the fundamental emotion that stands at the cradle of true art and true science. Whoever does not know it and can no longer wonder, no longer marvel, is as good as dead, and his eyes are dimmed."
I believe that our life has plenty of incredible mysteries that we can only uncover by meeting new cultures ๐ค.
At just 14 years old, I embarked on a transformative journey to Malaysia, living with an Asian family.
Later, I found myself in Brighton, England, working in a traditional fish and chips, trying to pay back my summer holiday with my best friend Francesco.
Also during my studies, I have shared my accommodation with international students (from Vietnam, Poland, France, Egypt, Russia, and China).
During this time, I had the privilege of acting in a short film crafted by my talented flatmate, Yuchen, a budding director. Our collaboration earned recognition at the Macau International Short Film Festival.
(Short-Film).