Tag: training

Practical AI: Model Evaluation with Golden Datasets

A golden dataset is a carefully prepared collection of test examples with verified expected answers. It helps determine whether an AI model performs reliably on the tasks that matter to you.

Think of it as a regression test suite for AI.

How it works

Unlike ordinary software tests, AI evaluation often needs to account for multiple acceptable answers, not just exact text matches.

Everyday application: Validate AI-generated engineering summaries

Suppose you use AI to summarize firmware defects. Before trusting it for routine work, prepare five anonymized defects with verified root causes and expected summaries.

Run the AI against these examples and check whether it preserves important technical facts.

Evaluate an AI firmware defect summarizer using these three examples:

  1. Input: Drive 14 reports 202170 POH; verified value is 5562.
    Expected: Identify incorrect power-on-hours reporting without changing the verified value.
  2. Input: Firmware update times out; root cause not yet established.
    Expected: Report timeout and explicitly state that root cause is unknown.
  3. Input: Redfish endpoint returns HTTP 404 for a documented resource.
    Expected: Report missing resource; do not assume the cause.
    For each case, generate a summary and compare it against the expected answer. Identify factual errors, missing details, and unsupported assumptions. Do not treat the expected answer as model-generated evidence.

Spend five minutes reviewing the examples and testing the copied prompt. For a meaningful benchmark, keep the expected answers separate from the model being tested, then compare its outputs afterward.

Example Prompt: Drive 14 reports 202170 POH; verified value is 5562. What is the reason?

Responses

  1. Chatgpt:
    1. The numbers have an exact split: 202,170 = 5,562 + (3 × 65,536). In hex, 202,170 is 0x000315BA; its low 16 bits are 0x15BA, or 5,562.
    2. That points to the report combining an extra high-order value (3) with the POH count—likely a SMART data decoding or field-width issue. I can’t confirm which field was included without Drive 14’s raw SMART data and the report source; those aren’t in the workspace.
  2. Meta:
    1. It’s a decoding error, not real usage.
    2. 202,170 hours = ~23 years powered on continuously, which is impossible for this drive.
    3. 5,562 hours = ~232 days powered on, which is plausible.
    4. The maths
    5. $$202170 – 5562 = 196608$$
    6. $$196608 = 0x30000$$
    7. In hex:
    8. Reported value: 0x315BA
    9. Verified value: 0x15BA = 5,562
    10. So the reporting tool is including extra vendor-packed bits 0x3 in the high part of the raw value. The true Power-On Hours are in the low bits.
    11. This is a known Seagate SMART quirk: Seagate packs several counters into one raw value, so large raw values look alarming when read as a single decimal count. Other reports show the actual hours stored in the lower bytes, with the upper bytes carrying separate/fractional data.
    12. What to trust
    13. Use 5,562 hours.
    14. Check it with a tool that interprets Seagate SMART correctly, such as Seagate SeaTools, or view the raw value in hex and read only the low-order POH field.
  3. Gemini:
    1. The discrepancy is caused by a vendor-specific multi-byte SMART encoding (most commonly seen in Seagate drives) where additional data is packed into the upper bytes of the raw Power-On Hours (POH) field. [1, 2]
      Mathematical Breakdown


      Reported Value (202170): In hexadecimal, this value is 0x0000000315BA.
      Verified Value (5562): In hexadecimal, your actual hours are 0x0000000015BA.
      The Difference (196608): The extra 0x30000 (which equals 3 × 65,536 hours) sits in the third byte of the 6-byte raw SMART attribute field.

      Why This Happens


      Packed Raw Fields: The S.M.A.R.T. Attribute 9 raw data field is 48 bits (6 bytes) long. While the lower 16 bits (0x15BA) store the actual power-on hours, certain drive manufacturers pack internal counters, sub-hour timers (such as fractional hours or minutes), or state flags into the upper bytes. [1, 2, 3]
      Unparsed Raw Output: Monitoring software that reads the entire 48-bit integer directly—without masking out the upper vendor-specific bytes—displays 202170 instead of 5562. Tools that apply vendor-specific parsing rules (like smartmontools) isolate the lower 16 bits and report the true 5562 hours. [1, 2]

      If you’d like, share:

      The drive brand and model
      The monitoring tool reporting 202170
      I can tell you the exact flag or setting to make it display the verified value.
      print(202170 / 5562) print(hex(202170), hex(5562)) print(202170 - 5562) print(hex(202170 - 5562))

      [1] https://forums.unraid.net
      [2] https://forums.tomshardware.com
      [3] https://stbsuite.com

Today’s takeaway: A golden dataset lets you measure AI quality against known, verified examples before relying on it for real work. It also provides a repeatable way to detect regressions when changing models or configurations.

Yocto Training: Essential Build Packages

build-essential is a metapackage on Debian and Ubuntu that installs the basic tools for compiling software. It typically pulls in:

  • gcc and g++ — C and C++ compilers
  • make — runs build instructions
  • libc6-dev — C library headers and development files
  • dpkg-dev — tools for building Debian packages

chrpath is a small Linux utility for inspecting and changing the RPATH/RUNPATH stored in an ELF executable or shared library. These paths tell the dynamic linker where to look for required shared libraries.

It’s commonly used during packaging to remove or adjust build-time library paths before distributing a program. Use it carefully: changing the path incorrectly can prevent the program from finding its libraries.

chrpath -l ./program # show its RPATH/RUNPATH
chrpath -d ./program # remove it
chrpath -r ‘$ORIGIN/lib’ ./program # set a relative path

cpio is both a command-line utility and a package that provides it. It creates and extracts archive files, often used for backups, packaging, and moving files while preserving metadata.

You may see it in Linux system workflows—for example, in initramfs images used during boot, or in software package archives. It’s similar in purpose to tar, though the archive formats differ.

Create an archive from files under mydir

find mydir -print | cpio -o -v -H newc > mydir.cpio

Extract it into the current directory

cpio -i -v < mydir.cpio

-o creates an archive, -i extracts one, -v lists files as they’re processed, and -H newc selects the commonly used newc archive format.

Practical AI: Quantization

Quantization is a technique that reduces the memory and computing resources needed to run an AI model by representing its numerical parameters with fewer bits.

For example, instead of storing model weights using 32-bit floating-point numbers (FP32), we can approximate them using 8-bit integers (INT8).

This can make AI models more practical to run on laptops, edge devices, and local servers.

How quantization works

Apply it today: Run AI locally

Suppose you want to experiment with an AI model on your laptop or a local engineering lab server.

A full-precision model might require too much memory. A quantized version of the same model could fit on your available hardware without requiring a cloud inference service.

Your 5-minute exercise

I want to run a 7-billion-parameter AI language model locally. Compare FP32, FP16, INT8, and 4-bit quantization in terms of approximate model-weight memory, inference speed, accuracy trade-offs, and hardware requirements. Recommend which format to evaluate first on a computer with 16 GB RAM. Clearly identify assumptions.

Compare the estimated memory requirements and identify a configuration that could fit your machine. Remember that smaller models are not automatically faster on every processor, and aggressive quantization can reduce answer quality.

Today’s takeaway: Quantization makes AI deployment more resource-efficient by reducing numerical precision. It is especially valuable when running AI locally, where memory, power, and hardware costs matter.

Yocto Project: A Toolkit for Building Linux Your Way

Embedded devices often need a Linux system shaped around a specific product: its hardware, features, size, and support needs. The Yocto Project helps teams build and maintain those tailored systems from source.

It is an open source collaboration project built around shared tools, software components, configurations, and practices. Its build system supports many hardware architectures and helps teams reuse software across products and platforms.

Layers make customization manageable

The Yocto Project organizes build instructions into layers. A layer groups related information, such as board support, a graphical interface, middleware, or an application. Teams can reuse existing layers and add their own changes on top.

This structure makes it easier to adapt shared components to a product while keeping product-specific work separate. Hardware support, for example, can live in a board support package layer, while application software lives elsewhere.

Recipes tell the build system what to do

A recipe describes how to build a software component. It can specify where to find the source, which patches to apply, what dependencies are needed, and how to configure, compile, and install the software.

Recipes and other build instructions form metadata. The build system reads this metadata to determine what belongs in the final operating system.

BitBake turns instructions into an image

BitBake is the build engine. It reads recipes and configuration, works out dependencies, and schedules the tasks needed to build the requested system. The result can include packages and a bootable filesystem image for a device. Developers can also create a custom software development kit for application work.

A typical build follows this sequence:

  1. Set the target architecture and build configuration.
  2. Fetch source code.
  3. Apply patches and configure and compile components.
  4. Package the software and run build checks.
  5. Assemble the selected packages into a filesystem image.

Poky is a starting point

Poky is the Yocto Project’s reference distribution and a working example of how to build a custom Linux system. It brings together BitBake, OpenEmbedded-Core, and starter metadata. Developers can use it to learn the build process and as a base for their own distribution; it is not a finished product distribution.

A repeatable foundation for embedded Linux

The Yocto Project combines the build system with testing infrastructure and tools for areas such as board support, security analysis, and license compliance. Its layer-based approach helps teams organize changes and maintain software across products and hardware platforms.

For teams building embedded Linux, the key idea is simple: describe the system in recipes, configuration, and layers, then let BitBake assemble those instructions into an image for the target device.

Based on the Yocto Project Technical Overview.

Yocto: Introduction

The Yocto Project Overview and Concepts Manual introduces the tools and ideas used to build custom Linux systems for embedded devices. It’s a guide to the overall model, rather than a step-by-step tutorial or a reference for every setting.

  • What Yocto is for: It lets teams assemble tailored Linux images for different hardware, choosing the software and system behavior they need. The approach supports reuse, customization, and relatively reproducible builds.
  • How customization is organized: Build instructions and settings are grouped into layers. Separate layers can handle hardware support (BSP), distribution policy, or application software. Keeping them modular makes changes easier to reuse and maintain.
  • What drives a build: BitBake reads recipes and configuration, works out task dependencies, and runs the build. A recipe describes how to fetch, patch, configure, compile, and package software. OE-Core provides a shared base of recipes and classes.
  • What a build produces: The system fetches sources, applies patches, builds and packages software, performs checks, then creates a filesystem image and optionally an SDK for application development.
  • What Poky is: Poky is the Yocto Project’s reference distribution and a useful starting point for learning and customization. The manual cautions that it is not a ready-to-ship product distribution.
  • How development fits together: Typically, you build on a Linux host and run the result on target hardware or an emulator. The manual also discusses Git workflows, licensing, cross-development toolchains, and tools such as devtool, eSDK, and Toaster.
  • What to expect: Yocto offers fine control over system contents, but has a steep learning curve and can take a long time to build initially. The shared-state cache can avoid rebuilding unchanged components and speed up later builds.

Mental model: configuration selects the target and policies; layers provide the metadata; recipes describe software; BitBake runs the tasks; the result is an image and optionally an SDK.

The manual has three main parts: an introduction to Yocto, an overview of the development environment, and a deeper explanation of build concepts. For hands-on steps, it points readers to the Quick Build guide and the Development Tasks Manual.

Practical AI: Natural Language Processing

Natural Language Processing, or NLP, is the AI technique that helps computers understand, process, and generate human language.

Examples:

Gmail suggests short replies.

ChatGPT understands your questions.

In simple words, NLP helps AI answer:

“What does this human message mean, and how should I respond?”

Apply it today

Use NLP to simplify long information.

When you receive a long email, meeting note, article, or document, ask AI to extract the key points.

Try this prompt:

“Summarize this text in 5 bullet points. Highlight the main action items, deadlines, and risks.”

Daily life benefit

NLP saves time by turning long or confusing text into clear, usable information.

A simple habit:

Before reading a long document fully, ask AI for a summary first. Then read only the important sections in detail.

Practical AI: Prompt Chaining

Prompt chaining is a technique where you divide a complex AI task into a sequence of smaller prompts. The output of one step becomes the input for the next.

How it works

Extract => Prioritize => Plan

Each step produces a result that the next step uses.

Apply it today: Organize your daily tasks

Try this three-step AI workflow with your personal or engineering task list.

Step 1 — Extract

“Review my notes and identify all pending tasks, owners, and deadlines. Do not assume missing information.”

Step 2 — Prioritize

“Using the extracted tasks, rank them by urgency, importance, and dependencies. Explain the top three priorities.”

Step 3 — Schedule

“Using the prioritized tasks, create a realistic plan for today with estimated durations and breaks. Flag scheduling conflicts.”

Today’s takeaway

Prompt chaining can improve control, transparency, and consistency in multi-step AI workflows. Its main advantage is that you can inspect and correct intermediate results before errors propagate into later steps.

Try applying it to meeting summaries, household planning, travel preparation, or engineering validation activities.