iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🌬️

Day 0: Why I am starting with Mistral AI now - Deconstructing the LLM

に公開

"I really want to start getting serious about Mistral..."

I am writing this down to articulate this feeling that has been in the back of my mind for the past few months.

This is not a tutorial.

This is a declaration of my intent to dive deep into Mistral AI and an attempt to organize the underlying uncertainties.


Premise: I already understand the conceptual level

I solidified my understanding of LLM-related concepts during the process of obtaining my AI Implementation Certification (S-Class).

  • Embedding
  • Self-Attention
  • Transformer Blocks
  • Pre-training / Fine-tuning / RAG

I believe I understand these at a level where I can "explain them for an exam."

However, that kind of study was closer to

Understanding on paper and in Python

and I still lack the "practical feel" of:

  • Running OSS LLMs in my own environment
  • Tuning inference
  • Properly designing the infrastructure for RAG and agents

So, as a way to reset my mind, I decided to draw the internals of an LLM before I go touch Mistral.


The "LLM Box" in diagrams

First, please look at this diagram I prepared.

Elements that appear in the AI Implementation Certification are summarized in this single sheet.

  • Token Embedding
  • Positional Encoding
  • Transformer Blocks × N
    • Self-Attention
    • Feed Forward (MLP)
    • Residual + LayerNorm
  • Output layer (Probability of next token)

On the left, I show the difference between "training" and "inference," and in the upper-right callout, I wrote:

"In Mistral, the Mixture of Experts (MoE) approach is incorporated into this Transformer block part."

In short, this is a diagram for visually sharing that:

  • LLMs are not just "mysterious black boxes."
  • They are computing devices with fixed patterns where these layers are stacked.
  • Mistral is tweaking the structure of the Transformer blocks within that.

Even if I think I understand the concepts, I have this goal: by drawing the "insides of the box" once before I start touching OSS, the resolution of my understanding will improve later.


From what perspective am I approaching LLMs?

Let me briefly introduce myself.

  • Engineer in my mid-40s.
  • Former SIer for about 20 years, focusing on development, maintenance, operation, and PM/PMO of medical software packages.
  • Currently focusing on cloud data platforms and overseeing projects from PoC to production for LLM/RAG.
  • Experienced in implementing RAG using Azure OpenAI in production, which reduced QA man-hours.
  • Certified in SnowPro Core for Snowflake.

In other words,

I am in a position that connects enterprise-side data infrastructure and LLMs.

In the long term, I want to be someone who can properly architect data and LLMs, no matter which site I go to. I chose Mistral as part of that journey.


Why Mistral "Now"?

I use GPT and Claude daily for LLMs. I would like to delve a bit deeper into the reasons why I decided to devote time to Mistral specifically.

1. I want to have a "brain I can keep at hand" rather than a "borrowed one"

Commercial APIs are convenient, but there is still a distance.

  • Models are updated according to the provider's convenience.
  • Training data and internal structures are not fully visible.
  • Latency and cost optimization are left to them to some extent.

On the other hand, the weights for Mistral's models are public, allowing me to run them in my own environment.

  • Mistral 7B / Mixtral 8x7B, etc.
  • Can be handled directly via Hugging Face / vLLM.
  • I can try quantization and inference optimization myself.

This feels similar to

"Wanting to properly handle OSS RDBMS, not just cloud managed databases."

Instead of relying solely on borrowed goods, I want to have an LLM I can keep at hand. I have chosen Mistral as the first candidate for this.

2. A stance as a "Third Pole" that is neither US nor China

The majority of LLMs tend to fall into a bipolar structure:

  • 🇺🇸 US (OpenAI, Anthropic, Meta, Google...)
  • 🇨🇳 China (Baidu, Alibaba, ByteDance...)

It is simply interesting that there is a player born in the EU that advocates for:

  • Data sovereignty
  • Privacy
  • OSS

As someone who has been involved for a long time in medical systems and systems that handle personal information, I am naturally sensitive to:

"Where does the data go?" and "Who is controlling it?"

Touching Mistral is, at the same time,

  • A study of technical OSS LLMs, and
  • A gathering of materials to think about a "future of AI that is not overly locked in."

3. Drawn to the "purity" of the technology

When I follow information around Mistral, I feel an atmosphere of being serious about "how to refine the model itself," such as:

  • The MoE structure of Mixtral
  • Designs aimed at achieving performance with smaller models
  • The sense of distance between OSS and the community

It feels like they are concentrating on the quality of the core LLM first, rather than on UX as a product or peripheral tools, which is refreshing to watch.

As someone focused on infrastructure and data platforms, I simply like products that go "all-in on the foundation."


What I will do in this series (Rough Roadmap)

I will roughly divide what I want to do with Mistral over the next six months or so.

Phase 1: Warming up (1-2 months)

  • Try running Mistral 7B / Mixtral on Google Colab
    • Via Hugging Face or vLLM
  • Confirm the "tactile feel" with simple prompt execution
    • Behavior in Japanese/English
    • Reactions to role instructions, etc.

Goal:
Acquire the sense of an "LLM that I launch and query myself," not an "LLM as a service."

Phase 2: Incorporating into RAG (2-3 months)

  • Build a simple RAG using my own technical notes and publicly available materials with Mistral
  • Try the same configuration with GPT / Claude to roughly compare accuracy, cost, and latency
  • Try changing the Chunking and Retrieval strategies little by little

Goal:
Confirm with my own hands that "RAG can be built straightforwardly with Mistral" and grasp the differences in "skin feel" between commercial LLMs and OSS LLMs.

Phase 3: Inference Optimization & Model Understanding (2 months and beyond)

  • Try quantization (4bit, 8bit)
  • Try acceleration with vLLM
  • Organize at a conceptual level how Mixtral's MoE is integrated into the Transformer blocks shown in the diagram
  • Be able to explain "why it has this structure" in my own words and diagrams

Goal:
Equip myself with the minimum set of skills to "operate an OSS LLM as infrastructure."


Image of the upcoming series

This Day 0 article is, so to speak, a declaration to myself.

After this, I plan to post the following content on Zenn:

  • #1: Further breakdown and explanation of the LLM structural diagram in this article
  • #2: Notes on running Mistral 7B / Mixtral on Colab
  • #3: Notes on the configuration of a simple RAG using Mistral
  • #4: A casual comparison between Mistral and commercial LLMs (GPT / Claude) from a RAG perspective
  • #5: Notes on trying out quantization and vLLM
  • #6: Conceptual notes on playing with Data Infrastructure × Mistral

I won't be doing everything rigidly, but I will write in order of what is most beneficial to my interests and my work.


In conclusion: Why Mistral (Once again)

  • I want to treat LLMs as "computing devices I can keep at hand" instead of just "convenient APIs."
  • I want to properly understand one OSS LLM as an option that doesn't rely solely on the US/China.
  • I want to taste products with high technological purity at the code level.

And above all,

"Because I simply love Mistral's philosophy and technology."

That is close to my real intention.

If there is anyone out there who says,

  • I'm using GPT / Claude,
  • But I'm just getting started with OSS LLMs,

I would be happy if we could sink into this swamp together casually.

*By the way, what does Mistral mean?
🌬 Mistral = A strong, cold north wind (seasonal wind) that blows in Southern France
Apparently.

(Next time, I plan to write a note on running Mistral on Colab while breaking down this structural diagram a little more.)

Discussion