Air Canada’s Chatbot: Why RAG Is Better Than An LLM For Facts

Recently Air Canada was in the news regarding the outcome of Moffatt v. Air Canada, in which Air Canada was forced to pay restitution to Mr. Moffatt after the latter had been disadvantaged by advice given by a chatbot on the Air Canada website regarding the latter’s bereavement fare policy. When Mr. Moffatt inquired whether he could apply for the bereavement fare after returning from the flight, the chatbot said that this was the case, even though the link which it provided to the official bereavement policy page said otherwise.

This latter aspect of the case is by far the most interesting aspect of this case, as it raises many questions about the technical details of this chatbot which Air Canada had deployed on its website. Since the basic idea behind such a chatbot is that it uses a curated source of (company) documentation and policies, the assumption made by many is that this particular chatbot instead used an LLM with more generic information in it, possibly sourced from many other public-facing policy pages.

Whatever the case may be, chatbots are increasingly used by companies, but instead of pure LLMs they use what is called RAG: retrieval augmented generation. This bypasses the language model and instead fetches factual information from a vetted source of documentation.

Continue reading “Air Canada’s Chatbot: Why RAG Is Better Than An LLM For Facts”

Big Chemistry: Hydrofluoric Acid

For all of the semiconductor industry’s legendary reputation for cleanliness, the actual processes that go into making chips use some of the nastiest stuff imaginable. Silicon oxide is comes from nothing but boring old sand, and once it’s turned into ultrapure crystals and sliced into wafers, it still doesn’t do much. Making it into working circuits requires dopants like phosphorous and boron to give the silicon the proper semiconductor properties. But even then, a doped wafer doesn’t do much until an insulating layer of silicon dioxide is added and the unwanted bits are etched away. That’s a tall order, though; silicon dioxide is notoriously tough stuff, largely unreactive and therefore resistant to most chemicals. Only one substance will do the job: hydrofluoric acid, or HFA.

HFA has a bad reputation, and deservedly so, notwithstanding its somewhat overwrought treatment by Hollywood. It’s corrosive to just about everything, it’s extremely toxic, and if enough of it gets on your skin it’ll kill you slowly and leave you in agony the entire time. But it’s also absolutely necessary to make everything from pharmaceuticals to cookware, and it takes some big chemistry to do it safely and cheaply.

Continue reading “Big Chemistry: Hydrofluoric Acid”

Car Driving Simulators For Students, Or: When Simulators Make Sense

There are many benefits to learning to fly an airplane, drive a racing car, or operate some complex piece of machinery. Ideally, you’d do so in a perfectly safe environment, even when the instructor decides to flip on a number of disaster options and you find your method of transportation careening towards the ground, or the refinery column you’re monitoring indicating that it’s mere seconds away from going critical and wiping out itself and half the refinery with it.

Still, we send inexperienced drivers in cars onto the roads each day as they either work towards getting their driving license, or have passed their driving exam and are working towards gaining experience. It is this inexperience with dangerous situations and tendency to underestimate them which is among the primary factors why new teenage drivers are much more likely to end up in crashes, with the 16-19 age group having a fatal crash nearly three times as high as drivers aged 20 and up.

After an initial surge in car driving simulators being used for students during the 1950s and 1960s, it now appears that we might see them return in a modern format.

Continue reading “Car Driving Simulators For Students, Or: When Simulators Make Sense”

Electrical Steel: The Material At The Heart Of The Grid

When thoughts turn to the modernization and decarbonization of our transportation infrastructure, one imagines it to be dominated by exotic materials. EV motors and wind turbine generators need magnets made with rare earth metals (which turn out to be not all that rare), batteries for cars and grid storage need lithium and cobalt, and of course an abundance of extremely pure silicon is needed to provide the computational power that makes everything work. Throw in healthy pinches of graphene, carbon fiber composites and ceramics, and minerals like molybdenum, and the recipe starts looking pretty exotic.

As necessary as they are, all these exotic materials are worthless without a foundation of more familiar materials, ones that humans have been extracting and exploiting for eons. Mine all the neodymium you want, but without materials like copper for motor and generator windings, your EV is going nowhere and wind turbines are just big lawn ornaments. But just as important is iron, specifically as the alloy steel, which not only forms the structural elements of nearly everything mechanical but also appears in the stators and rotors of motors and generators, as well as the cores of the giant transformers that the electrical grid is built from.

Not just any steel will do for electrical use, though; special formulations, collectively known as electrical steel, are needed to build these electromagnetic devices. Electrical steel is simple in concept but complex in detail, and has become absolutely vital to the functioning of modern society. So it pays to take a look at what electrical steel is and how it works, and why we’re going nowhere without it.

Continue reading “Electrical Steel: The Material At The Heart Of The Grid”

Parts We Miss: The Mains Transformer

About two decades ago there was a quiet revolution in electronics which went unnoticed by many, but which overturned a hundred years of accepted practice. You’d have noticed it if you had a mobile phone, the charger for your Nokia dumbphone around the year 2000 would have been a weighty device, while the one for your feature phone five years later would have been about the same size but relatively light as a feather. The electronics industry abandoned the mains transformer from their wall wart power supplies and other places in favour of the much lighter and efficient switch mode power supply. Small mains transformers which had been ubiquitous in electronics projects for many years, slowly followed suit.

Coils Of Wire, Doing Magic With Electrons

Inside and outside views of Jenny Lists's home made linear power supply from about 1990
This was a state of the art project for a future Hackaday scribe back in 1990.

A transformer works through transferring alternating electrical current into magnetic flux by means of a coil of wire, and then converting the flux back to electric current in a second coil. The flux is channeled through a ferromagnetic transformer core made of iron in the case of a mains transformer, and the ratio of input voltage to output voltage is the same as the turns ratio between the two. They provide a safe isolation between their two sides, and in the case of a mains transformer they often have a voltage regulating function as their core material is selected to saturate should the input voltage become too high. The efficiency of a transformer depends on a range of factors including its core material and the frequency of operation, with transformer size decreasing with frequency as efficiency increases.

When energy efficiency rules were introduced over recent decades they would signal the demise of the mains transformer, as the greater efficiency of a switch-mode supply became the easiest way to achieve the energy savings. In a sense the mains transformer never went away, as it morphed into the small ferrite-cored part running at a higher frequency in the switch-mode circuitry, but it’s fair to say that the iron-cored transformers of old are now a rare sight. Does this matter? It’s time to unpack some of the issues surrounding a small power supply. Continue reading “Parts We Miss: The Mains Transformer”

They Want To Put A Telescope In A Crater On The Moon

When we first developed telescopes, we started using them on the ground. Humanity was yet to master powered flight, you see, to say nothing of going beyond into space. As technology developed, we realized that putting a telescope up on a satellite might be useful, since it would get rid of all that horrible distortion from that pesky old atmosphere. We also developed radio telescopes, when we realized there were electromagnetic signals beyond visible light that were of great interest to us.

Now, NASA’s dreaming even bigger. What if it could build a big radio telescope up on the Moon?

Continue reading “They Want To Put A Telescope In A Crater On The Moon”

How Much Longer Will Cars Have Cigarette Lighter Ports?

Depending on the age of your car, it might contain a round 12 V power outlet in the dash, or possibly in the elbow compartment. And depending on your own age, you might know that as the cigarette lighter port. Whereas this thing used to have a single purpose — lighting cigars and cigarettes via hot coil — there are myriad uses today, from charging a phone to powering a dash camera to running one of those tire-inflating machines in a roadside emergency.

But how did it come to be a power source inside the vehicle? And how long will it stick around? With smoking on the decline for several decades, fewer and fewer people have the need for a cigarette lighter than do, say, a way to charge their phone. How long will the power source survive in this configuration?

Continue reading “How Much Longer Will Cars Have Cigarette Lighter Ports?”