Skip to main content

5 posts tagged with "machine learning"

View All Tags

Order Sensitivity in LLM Decision Models: The Flashlight That Became a Solar Calculator

· 11 min read
Manu Mishra
Distinguished Solutions Architect, Author & Researcher in AI & Cloud

Same decision, any order—Strands Gemma E2B

Imagine a product team alphabetizes a dropdown and the AI recommendation changes. The available choices are identical. Their meanings are identical. Only their display order moved, yet the model picks something else.

I saw a clean example while evaluating an LLM-based decision model.

Question

Which device directly converts chemical energy to electrical energy?

Choices

  • A solar-powered calculator
  • A wood-burning stove
  • A battery-powered flashlight
  • A wind-powered sailboat

A Strands Gemma E2B checkpoint selected the battery-powered flashlight—the correct answer—with an API-returned probability of 0.5589. I then reversed the same four choices. The checkpoint selected the solar-powered calculator with probability 0.5615.

Semantic optionOriginal orderReversed order
solar-powered calculator0.12240.5615
wood-burning stove0.12290.0967
battery-powered flashlight — correct0.55890.2873
wind-powered sailboat0.19580.0545

These columns are aligned by semantic identity: the solar calculator is compared with the solar calculator, regardless of which row displayed it. This was not an index-mapping error. The selected meaning changed. That flashlight became the starting point for a broader systems question: when choices are conceptually a set, why should display order affect the decision?

The pattern was wider than one model​

I applied the same treatment to four public decision models. Each received the same 3,900 questions twice: first in source order, then in complete reversal, meaning the last choice became first, the next-to-last became second, and so on. The question, context, and choice text stayed unchanged.

Tested modelAnswers changed after reversalOriginal-order accuracy
Laya1,426 / 3,900 (36.56%)49.49%
Strands Hobson839 / 3,900 (21.51%)72.13%
Strands Gemma E2B851 / 3,900 (21.82%)73.00%
Strands Gemma E4B563 / 3,900 (14.44%)79.26%

Before counting a change, the evaluator mapped both responses back to the original semantic choices. It asked whether the winning meaning changed, not whether the winning row number changed. All four models also returned zero failed or invalid responses, so the rates are not inflated by malformed output.

This comparison is evidence about these tested model releases, their native typed-choice interfaces, and the recorded runtime—not a claim that every LLM behaves this way. It also tests one transformation, complete reversal, rather than every possible permutation. Even within that bounded test, every jointly encoded model changed a meaningful share of its decisions. The most accurate model, Strands Gemma E4B, still changed about one answer in seven.

The full protocol and per-task results are in the immutable cross-model order-sensitivity evidence. That cross-model study was published after the v0.1.0 project release; it adds comparative evidence but does not change the released runtime or model components.

Project release: GitHub source, runtime, tests, and evidence (v0.1.0) · Hugging Face model components (v0.1.0)

Laya on AWS Lambda - A Curiosity-Driven Experiment with a Decision Model

· 8 min read
Manu Mishra
Distinguished Solutions Architect, Author & Researcher in AI & Cloud

Laya on AWS Lambda

Note: This is a curiosity-driven experiment, not a production recommendation. Cold starts are long, the ARM64 path doesn't work, and confidence scores aren't calibrated. For real workloads, look at Amazon SageMaker, Amazon Bedrock, or a warm, right-sized container service.

1. The idea​

First I ran a 1.58-bit LLM on Lambda. Then an embedding model. Both worked, with the usual serverless caveats. That left one more kind of model I was curious about: one that doesn't generate text or vectors, but makes a decision.

Laya is exactly that. It's an open-weight (Apache-2.0), 421M-parameter model that reads some text, answers a typed question about it, and returns a bounded answer in a single forward pass. Could that run on Lambda, CPU only, with no inference server? Only one way to find out.

Recursive Language Models on AWS with Strands Agents

· 12 min read
Manu Mishra
Distinguished Solutions Architect, Author & Researcher in AI & Cloud

RLM on AWS Architecture

Introduction​

Modern large language models face a fundamental limitation: context windows. While frontier models now reach 1 million tokens (Nova Premier, Claude Sonnet 4.5), workloads analyzing entire codebases, document collections, or multi-hour conversations can easily exceed 10 million tokens—far beyond any single model's capacity.

This post demonstrates Recursive Language Models (RLMs), an inference strategy from MIT CSAIL research that enables scaling to inputs far beyond context windows. What makes this implementation special: Strands Agents and Amazon Bedrock AgentCore reduce what could be weeks of glue code and deployment work to just a few hours of development.

Google's EmbeddingGemma on AWS Lambda - A Curiosity-Driven Experiment

· 6 min read
Manu Mishra
Distinguished Solutions Architect, Author & Researcher in AI & Cloud

EmbeddingGemma on AWS Lambda

Note: This is a curiosity-driven experiment, not a production recommendation. For real workloads, Amazon SageMaker is the right choice. This project explores what's possible when you push serverless boundaries.

1. The idea​

After my BitNet Lambda experiment, I kept thinking: what about embeddings? I had text generation working on Lambda, but what about the other half of modern AI applications?

Google's EmbeddingGemma caught my attention—300M parameters, multilingual, designed for efficiency. Could it work on Lambda? Only one way to find out.

So I fired up Amazon Q Developer and started experimenting.

Running 1.58-bit LLMs on AWS Lambda with BitNet

· 6 min read
Manu Mishra
Distinguished Solutions Architect, Author & Researcher in AI & Cloud

BitNet on AWS Lambda

✨ What you'll learn (tl;dr) In ~12 minutes you'll see how to deploy Microsoft's BitNet 1.58-bit quantized LLM on AWS Lambda, the container-based architecture, and performance benchmarks across different memory configurations using the microsoft/bitnet-b1.58-2B-4T model.

Big idea: 1.58-bit quantization enables LLM deployment on Lambda's CPU infrastructure. At ~1.1GB, the model fits within Lambda's constraints for serverless AI inference.