The Math You Need To Start Understanding LLMs

Once you peel back the hype and mysticism, large language models (LLMs) are a fascinating application of statistical models, effectively what you get when you dial a basic auto-complete model up to eleven. In order to analyze a mind-boggling amount of text and produce meaningful auto-completion results quite a bit of math is involved, with a recent three-part article series by [Giles] going through the basics of inference, being the prediction step using a trained model.

The text is encoded in the LLM’s vector space as token IDs, each token being a text fragment that has some probability of following another ID, such as when cats may be found on desks, as in the above photo by [Giles]. With inference multiple of such IDs are retrieved in a vector from which in successive steps a sentence can be pieced together. These so-called logits are detailed in the first article in the series, with the second article focusing on vocabulary space and embedding, as well as the matrix operations used for inference.

Finally, the third article puts all of this together and looks at transformers, which is a crucial part of GPT (generative pretrained transformer) LLM architecture. Of note is the attention mechanism, which takes GPTs beyond merely being glorified auto-complete systems by adding pattern matching. Here we can see how the statistical model of the LLM is used to generate a rather plausible output, which is where the human has to ask themselves in how far they feel that it is correct.

Of course, there goes a lot more into making LLMs and GPTs performant, such as key-value caches that massively speed up inference.

Teardown Of A Shahed-136 Gimbaled Camera

The remains of a gimbal camera after its drone was shot down. (Credit: Le labo de Michel, YouTube)
The remains of a gimbal camera after its drone was shot down. (Credit: Le labo de Michel, YouTube)

The Iranian Shahed-136’s basic design has seen many changes and additions since Russia began using them, with some featuring interesting payloads such as cameras in a gimbal, making these drones useful for tasks like surveillance. Recently [Michel] got his hands one one such camera that was recovered from a shot-down drone in Ukraine, providing the opportunity for an in-depth look at what hardware is in these cameras.

The teardown thus covers the gimbal mechanism itself as well as the electronics and camera. First up is an Artix-7 FPGA-based board, followed by the range finder assembly. Unsurprisingly the camera feed handling is performed by an Hi3519 SoC, as this appears to be the off-the-shelf option you find all over on AliExpress and similar sites. There’s also an Artix-7 FPGA-based board here, which presumably performs some machine vision tasks or similar.

Continuing the ‘bought off AliExpress’ vibe, the power supply board (pictured above) is quite literally just that. A relay board follows the same pattern, with apparently the entire contents of the camera consisting of off-the-shelf development boards and modules that are readily found for sale online.

For the camera there is a thermal camera presumably for night operations, as most of these drone swarms are launched towards Ukraine at night. Looking at the gimbal assembly it similarly feels like it was sourced off AliExpress, featuring mostly Western components, sometimes with the typical lasered-off component markings and such.

This makes one wonder how much has changed here since nearly two years ago we saw an air data computer from a similar drone that could have been sourced off AliExpress, while the Russian missile teardowns show significantly more custom hardware, presumably because those are harder to source off AliExpress.

Continue reading “Teardown Of A Shahed-136 Gimbaled Camera”

Strange Ways To Make Cold

Making stuff cool and keeping it that way has been a pretty essential part of human civilization for thousands of years, with only in the past few hundred years man-made methods having become available that remove the reliance on the whims of nature and lugging around massive blocks of ice. The most important cooling method is undoubtedly that of vapor-compression refrigeration, but this is hardly the only method to transfer thermal energy from one location to another.

For example, we recently covered an elastocaloric cooling project by a group of scientists that uses strips of NiTi metal. By flexing these they induce a cooling effect which when put in a number of stages serves to transfer a significant amount of thermal energy between both sides, much like a vapor-compression system but without the gases and compressor. Meanwhile the Seebeck effect is relatively well-known from Peltier thermocouple devices, and features heavily in portable refrigerators and kin where these solid-state devices can also transfer thermal energy.

Of course, along with how they function the major question with all of these cooling technologies is how efficient they are, as this determines when you’d want to even consider them for a specific application.

Continue reading “Strange Ways To Make Cold”

ReactOS Gets Unified Installer Image And A New Storage Stack

Although the ReactOS project is in no rush to dethrone Windows as the desktop operating system of choice, this doesn’t mean that some real changes aren’t happening. Most recently two big changes got merged, the first pertaining to the separate boot- and live CD images that are now merged into a single image, and the second being a new PnP-aware ATA storage stack for ATA and AHCI devices, with NT6+ compatibility.

Although there is still a separate live CD for now, this first change means that testing and installing ReactOS becomes easier, and that the old-school text-based installer may soon be on its way out as well.

Having the new ATA storage stack in place will translate into much better compatibility with real hardware, including the ability to use more hardware to install on and boot from compared to the old UniATA driver.

Combined, these two changes should bring the ReactOS installation and usage experience a lot closer to that of Windows, as well as many Linux distros. If you had issues with the OS on real hardware, this might be just the right time to give it another shake and provide detailed feedback to the developers if any remaining issues are encountered.

Thanks to [jeditobe] for the tip.

Squeezing Fluids With The Right Peristaltic Pump For The Task

Peristaltic pumps are a very simple and effect device for transferring fluids without said fluid ever coming into contact with any part of the pump mechanism. At their core they involve a mechanism squeezing fluids through compressible tubing, but there are various implementations of such a mechanism that all have their pros and cons. In a recent article by [T. K. Hareendran] over at EDN these types are discussed and when you’d want to pick one over the other.

Also known as a roller pump, these positive displacement pumps have been known since the 19th century, finding uses in industrial, medical, research, agriculture and many other fields. Each of these fields have different requirements with the use of a peristaltic pump as a dosing pump being a specific application whereby e.g. a stepper motor can be used to provide exact dosing.

For industrial settings the typical rollers that compress the tube are replaced with shoes that provide higher pressures and endurance, with overall a bewildering number of motor types and tubing materials available. Depending on what your project needs, you may opt for continuous flow, fine control over dosing, the ability to reverse the flow, etc.

Unless your project is particularly rugged, a roller-based mechanism should be fine, while silicone tubing is great for biocompatibility and PVC is a cheaper tube material option. If you intend to transfer certain kinds of chemicals that will react with each of these there are some more exotic tubing options available as well.

We have previously covered projects that use a peristaltic pump for rather interesting things, such as DIY pharmaceutics, in a home-grown flow battery, not to mention creating DIY peristaltic pumps from first principles.

Debugging A Stopped Foucault Pendulum’s Electronics

After the Foucault pendulum at the Houston Museum of Natural Science stopped working a while back after maintenance on the building, workers set out to determine what was wrong with the mechanism that normally keeps it in motion. Fortunately, it turned out that all they had to do was fiddle with some knobs to get everything dialed back in proper-like.

When we previously covered this dire event, it was claimed that this was a one-off system, hacked together by some random bloke. But as can be seen in the video and further detailed in the comments to the video the reality is far more interesting.

This particular Foucault pendulum is one of many that were created by the California Academy of Sciences, with hundreds of them installed throughout the US and possibly elsewhere. That said, since a pendulum of any description will never be a perpetual motion device, the electromagnet installed near the top of the installation has to carefully add some kinetic energy back that was lost due to friction as the pendulum moves around.

Sadly the video doesn’t go into much detail on what exactly was wrongly configured with this particular pendulum. Keeping a weight at the end of a long cable moving around at a set velocity is a tricky business, so it’s little wonder that getting some parameters wrong would engage and disengage the electromagnets at the wrong times and making the pendulum stop swinging.

Continue reading “Debugging A Stopped Foucault Pendulum’s Electronics”

Running DOOM On A Travel Router With Touch Screen

Continuing his quest to put DOOM on literally everything that has a capable enough processor and a screen, [Aaron Christophel]’s most recent target is a Slate 7 Pro travel router. With a generous 2.8″ touch screen and a lot of onboard processing power to handle all the advertised networking and routing features via its WAN and (W)LAN interfaces, it should be able to run the game really quite well. As usual the main question is how to get the game to run on it first.

The port of choice is fbdoom, with instructions on how to run it on this router provided on the GitHub project page. The reason for the touch screen is so that you can see the status of interfaces and interact with it without having to open the web interface. Boringly, this router has an SSH daemon ready to connect to, giving you full root access to the Linux-based firmware.

It’s just your typical AArch64 ARM-based system, with the gl_screen process running for the touch screen display. From there it was easy enough to deduce the settings to jot into fbdoom so that it too could use the same screen and touch inputs. After copying the compiled binary with SCP over to the router, it can then be started like any application. With touch inputs somewhat awkwardly mapped to certain areas of the touch screen, it’d be nice to see the USB 2.0 port used for USB HID inputs, but it does show how easy things can be when it runs something like Linux and you got full root access.

Incidentally this also heavily blurs the lines between something like a Valve Steamdeck and a router, with the latter just missing some gamepad controls on the side to do some on-the-go gaming when you’re not using it for routing network traffic.

Continue reading “Running DOOM On A Travel Router With Touch Screen”