AIニュース最前線
最新ニュースAI日報Hacker日報週報動画AIツールトレンド企業

AIニュース最前線

世界中のAI最新情報を日本語で毎時更新

最新ニュース日報トレンド企業プレミアムRSS
© 2026 ainew.jp特定商取引法に基づく表記
ニュース一覧元記事を開く
NVIDIA Developer Blog·2026年6月17日 05:30·約16分で読める

金融インテリジェンスのためのトランザクション基盤モデルを自作する

#Financial AI#Foundation Model#NVIDIA#Domain Adaptation#Transaction Intelligence
TL;DR

NVIDIA は金融分野の専門知見を統合した独自トランザクション基盤モデルの構築手法を発表し、業界全体のデータ分析と意思決定の効率化への応用可能性を示唆している。

AI深層分析2026年6月17日 06:02
3
注目/ 5段階
深度40%
4
関連度30%
4
実用性20%
3
革新性10%
3

キーポイント

1

金融特化型基盤モデルの構築

汎用的な AI モデルではなく、金融取引の文脈や規制、リスク管理などの専門知見を学習に組み込んだ独自のトランザクション基盤モデルの設計手法が提示されている。

2

業界応用可能性の示唆

このアプローチは単なる技術デモではなく、金融機関における不正検出、取引分析、コンプライアンス対応など、実務レベルでの具体的な活用シナリオを想定している。

3

NVIDIA Developer Blog による発信

開発者コミュニティ向けに技術的詳細と実装の指針を提供することで、金融 AI のエコシステム拡大を促進する戦略的なコンテンツとなっている。

影響分析・編集コメントを表示

影響分析

この発表は、AI が単なる汎用ツールから、業界固有の深い文脈を理解できる専門パートナーへと進化していることを示す重要な指標です。特に金融のような規制とリスク管理が厳格な分野において、ドメイン知識を統合したモデルの実現可能性が高まることで、実務への導入スピードが加速する可能性があります。

編集コメント

金融業界特有の文脈を AI にどう組み込むかという課題に対し、具体的な解決策の方向性を示した内容です。実装の詳細は開発者向けブログとして公開されていますが、業界全体のパラダイムシフトを示唆する重要な一歩と言えます。

現代の金融ネットワークにおけるすべてのスワイプ、送金、決済は、人間の行動のパターンを符号化しています。取引データは、企業が保有する最も豊富なシグナルの一つです。しかし、そのような表形式データの生産環境でのユースケースの多くは、依然として手作業で設計された特徴量やルールセットに依存しており、それらは脆く、維持コストが高く、顧客履歴内の時系列構造を見逃すという欠点があります。

大規模なラベルなし取引シーケンスで事前学習されたファウンデーションモデルは、広範な下流タスク間で転移可能な金融行動の汎用的表現を生成することで、この方程式を変えます。単一のバックボーンが、不正検出、与信スコアリング、顧客生涯価値予測、セグメンテーション、パーソナライズされたレコメンデーション、反復取引の検出など、多岐にわたるタスクをカバーします。

業界のシグナルは強く、加速しています。革新的な金融企業は、数十億件の取引データを用いてトランスフォーマーベースのモデルをトレーニングしており、本番環境規模のタスクにおいて二桁の相対的な性能向上を報告すると同時に、業務の効率化も進めています。Stripe の payments foundation model、Nubank の NuFormer、Visa の TransactionGPT、Mastercard の large tabular model、Revolut の PRAGMA、Plaid の transaction foundation model などをご覧ください。

NVIDIA の Build Your Own Transaction Model developer example では、アクセラレーテッドコンピューティング(高速計算)を用いてトランザクション基盤モデルをエンドツーエンドで構築する方法を解説しています。

このワークフローでは以下の 5 つのステップを進めます:

  • NVIDIA CUDA-X ライブラリ cuDF を用いた GPU アクセラレーションされたデータ処理
  • NVIDIA CUDA-X ライブラリ cuDF と cuML を用いたカスタムトークン化
  • NVIDIA NeMo フレームワークの一部である NVIDIA NeMo AutoModel オープンライブラリを用いた、ゼロからのトランスフォーマーデコーダーモデルの事前トレーニング
  • 学習された埋め込み(embeddings)の抽出
  • 埋め込みを用いた下流の不正検出分類器の拡張

最終的には、IBM TabFormer の不正検出データセット上で強力な XGBoost ベースラインと比較して、平均精度("AP":正答率・再現率曲線下の面積。これはモデルがすべての運用閾値において不正をどの程度正確にランク付けできるかを示す指標)で約 50% の向上を実現します。以下の図 1 は、エンドツーエンドのパイプラインを示しています。

imageimage*図 1. エンドツーエンドのトランザクション基盤モデル・パイプライン:生データは NVIDIA CUDA-X ライブラリを用いた GPU アクセラレーションされたデータ処理とドメイントークン化を経て流れ、NeMo AutoModel で事前学習されたトランザクション基盤モデルを介し、ダウンストリームの表形式モデルへの埋め込み抽出が行われます***

なぜトランスフォーマーがトランザクション履歴に適しているのか

大規模言語モデルは単語の連続から学習します。事前学習中、モデルはテキストを見て、単語や句、文が順序と文脈を通じて意味を担うことを学びます。トランザクション基盤モデルはこの原則を金融行動に適用するものです。「給与振込、食料品購入、交通費、定期購読、カード決済によるレストラン利用」といった一連の事象は、単一のトランザクション行だけでは表現できない情報を伝えます。

トランスフォーマーはこの構造に非常に適しています。なぜなら、自己注意機構(self-attention)は、歴史上の遠く離れたイベント同士を結びつけることができるからです。不正取引は、直近の旅行パターンや突然発生する少額承認のバーストと組み合わさった場合にのみ不審に見えることがあります。従来の表形式の特徴量ではこれらのパターンを近似することは可能ですが、エンジニアが事前にどのウィンドウ、集計値、ルールを構築するかを決定する必要があります。一方、事前学習済みトランスフォーマーは、その関係性をシーケンスから直接学習します。

このアプローチは、グラフニューラルネットワーク(GNN)を用いた NVIDIA AI Blueprint for financial fraud detection など、他の NVIDIA 金融 AI ワークフローを補完するものです。GNN は、アカウント、マーチャント、デバイス、取引といった接続されたエンティティ間の関係を捉えます。一方、トランザクション基盤モデルは、顧客またはアカウントのシーケンス内の行動履歴に焦点を当てます。実際には、両方の手法が自然に組み合わさる相補的な情報を持つ豊富な埋め込み(embeddings)を生成します。

データの読み込みとベースラインの設定

Notebook 01_dataset_baseline.ipynb は、IBM TabFormer dataset を直接 GPU メモリにロードします。これは約 2,440 万件の合成カード取引データで、不正取引率は約 0.12% です。この処理には cuDF が使用されます。

データセットの分割は、累積取引数に基づいて時間的に区分されます:日付順に最初の 80% の取引がトレーニングに使用され、次の 10% が検証用、残りの最終 10% がテスト用に割り当てられます。これにより、各分割は互いに排他的で順序付けられた時間ウィンドウを占めることになり、データリークを防ぎつつ、実際の運用環境を反映します。

この分割構成を整えた後、ノートブックでは 100 万行のバランス型トレーニングサンプルに対して、tree_method="hist" および device="cuda" を指定してネイティブ GPU アクセラレーションを活用した XGBoost クラスファ(分類器)を学習させます。評価は、現実的な約 0.1% の不正取引発生率を保持する 10 万件の層別化ホールドアウトデータセット上で実行されます。

ベースラインの数値は、本チュートリアルの残りの部分における基準となります:

  • テスト用 ROC-AUC: 0.9885
  • テスト用 AP: 0.1238

ROC-AUC よりも AP(平均精度)に注目してください。クラス不均衡が 0.1% を下回る状況では、ROC-AUC はすぐに飽和し、高スコア領域における意味のある差異を隠してしまいます。AP は全リコール曲線にわたって測定され、運用上重要な改善点に対して敏感に反応します。本チュートリアルで登場するすべての後続モデルは、まず AP によって評価されます。

GPU で取引データをトークン化する

汎用 LLM トークナイザーは、表形式の金融データに対して容量を無駄に消費します。例えば、バイトペアエンコーディング(BPE)トークナイザーでは、1 つの取引が約 39 のサブワードトークンに分割されますが、その多くは行動ではなくカンマやドル記号を符号化しています。Notebook 02_seq_preproc_tokenization.ipynb では、各取引を約 12 の意味的トークンに変換し、BPE(50,257 語)と比較してはるかに小さい語彙数(6,251 記号)を持つカスタムドメイントークナイザーを紹介しています。

トークン情報の密度に加えて、この効率化により、設定されたトークン予算に対して 3 倍以上の取引数を処理可能になります。実用的には、コンテキストウィンドウが 4,092 のモデルにおいて、ドメイントークナイザーを使用すれば約 315 件の取引履歴を収容できますが、BPE トークナイザーでは約 102 件しか収容できません。

以下の図 2 は、同じレコードにおける 2 つのトークン化手法間の取引あたりのトークン数を比較しています。

ドメイントークナイザーは src/tokenizer/financial_pipeline.py に実装されています。この柔軟なパイプラインは、金額のビン化、merchant ハッシュ、1 日の時刻と曜日の扱い、月、カードID、チップタイプ、ZIP3 と州、顧客IDを処理します。すべてのステップが cuDF を介して GPU で実行されます。

トークナイザーは、モジュラーパイプライン内の個々のステップを追加または置き換えることで、異なるトランザクションスキーマに容易に適応できます。各ステップは小さな BaseTokenizer インターフェースを実装しているため、デバイス ID や受益者国などの新しいフィールドへの対応範囲を広げるには、短いサブクラスを作成するだけで済みます。

imageimage*図 2. 同じ TabFormer レコード上での、ドメイン固有トークナイザー(トランザクションあたり約 12 トークン、語彙数 6,251 記号)と GPT-2 BPE(トランザクションあたり約 39 トークン、語彙数 50,257 記号)のトークン効率性の比較*

NeMo AutoModel を用いた事前学習

NeMo AutoModel は、NVIDIA Neomo Framework に属する PyTorch ネイティブなオープンソーストレーニングライブラリであり、大規模言語モデル(LLM)や視覚言語モデル(VLM)のトレーニングおよびファインチューニングを合理化し、スケーラブルにするために設計されています。

Notebook 03_foundation_model_training.ipynb は、因果言語モデリングを用いてトークン化されたコーパス上でデコーダー専用の基盤モデルを事前学習します。目的は単純です——すべての以前のトークン给定して次のトークンを予測することですが、その教師信号は高密度です。シーケンス内のすべての位置が勾配に寄与するため、1 つのパッキングされたトランザクションシーケンスから数千の次イベント予測が得られます。

モデルは、configs/pretrain_financial_decoder.yaml で定義されたコンパクトな Llama デコーダーです:

  • パラメータ数:約 29M
  • ヒドゥンサイズ 512、8 層のトランスフォーマーレイヤー
  • グループ化クエリアテンション(Grouped-Query Attention)を採用し、クエリヘッドは 8、KV ヘッドは 2
  • 8,192 トークンの RoPE コンテキストウィンドウ
  • SwiGLU アクティベーション関数、RMSNorm、ドメイン固有の語彙サイズは 6,251 トークン

NeMo AutoModel が残りのスタックを処理します。単一 GPU での簡易実行を開始しましょう。

python scripts/train_decoder_model.py \

--config configs/pretrain_financial_decoder.yaml \

--step_scheduler.max_steps 30

この 30 ステップのデモでは、トレーニング損失が ln(6251)≈8.74(本語彙に対するランダム推測のベースライン)から約 6.0 に低下します。同じ実行を 8 台の GPU でスケールさせるには、コマンドの前に torchrun --nproc-per-node=8 をプレフィックスするだけでよく、スクリプトや分散処理用のボイラープレートに変更は不要です。マルチノードでのスケールも同様に簡単です。NeMo AutoModel は YAML から FSDP2 シャーディング、混合精度計算、勾配累積、チェックポイント統合を自動的に設定します。

チェックポイントは標準的な safetensors ファイルとして保存されるため、HuggingFace Transformers がインストールされている環境であれば、一行でトレーニング済みバックボーンを読み込めます:

from transformers import AutoModelForCausalLM

model = AutoModelForCausalLM.from_pretrained("models/decoder-foundation-model")

このリポジトリには、3,000 ステップのトレーニング済みフルチェックポイントが含まれており、Notebook 04 と 05 で読み込まれます。一方、30 ステップのテストはデモンストレーションおよび検証目的のためのものです。

アーキテクチャを切り替える場合は、YAML ファイル内の model._target_ および model.config._target_ を編集してください。HuggingFace に互換性のあるデコーダーであれば、トレーニングコードの変更なしにそのまま導入可能です。

Notebook 04_inference_embedding_extraction.ipynb は、事前学習済みバックボーンを特徴抽出器として機能させます。このノートブックは AutoModelForCausalLM を用いてチェックポイントをロードし、output_hidden_states=True を指定して最終的な隠れ層の出力を要求します。その後、各ユーザーの履歴に対して 512 次元ベクトルにプーリング処理を行います。

因果的アテンションを持つデコーダー専用モデルの場合、最終位置のみがシーケンス全体を観察しており、それ以前の位置は後続のトークンを認識できません。そのため、最後のトークンでのプーリングは、シーケンス内で最も情報量の多い位置を選択することになります。src/decoder_inference.py に実装されているロジックでは、アテンションマスクを使用して各行の最後のパディングされていないトークンを特定し、その隠れ状態を取得します。

抽出ループは単一の呼び出しで完了します:

embeddings = inference.extract_embeddings_batched(

padded_ids, batch_size=1024, show_progress=True

)

このノートブックでは、トレーニング用、検証用、テスト用の埋め込みベクトルを .npy ファイルとして抽出・保存します。さらに、形状と行の整合性を記述した metadata.json も保存され、これは後続の Notebook 05 で埋め込みベクトルを関連する生テーブル特徴データに結合する際に使用されます。

以下の図 3 は、50,000 件の検証用埋め込みベクトルの 3D UMAP プロジェクションを示しており、小売業の業界カテゴリと郵便番号によって色が付けられています。各フィールドに見えるクラスタは、事前学習中にターゲットラベルを一度も見たことがないにもかかわらず、バックボーンが意味的に一貫した表現を学習したことを裏付けています。

image
image
image
image

*図 3. 検証セットの取引埋め込みベクトルの 3D UMAP プロジェクション。小売業の業界とユーザーの郵便番号で色付けされた各点は、学習された表現空間において明確な行動クラスタを示しています*

下流タスクでのリフトを測定する

Notebook 05_xgboost_fraud_detection.ipynb は、10 億ドルの質問に答えるものです:取引基盤モデルの埋め込みベクトルは、下流の指標を改善できるでしょうか?

このノートブックでは、3 つの GPU 対応 XGBoost クラスファ(分類器)を訓練し、すべて同じく層化サンプリングされた 10 万件のテストセットで評価します。

  • Raw(生データ):手作業で作成した 13 の表形式特徴量(ステップ 1 のベースライン)
  • Embeddings(埋め込み):512 次元の基盤モデルベクトルを PCA で圧縮し、64 次元化(約 78% の分散を保持)
  • Combined(結合):生の特徴量と 64 次元の埋め込みベクトルを連結した合計 77 次元

以下の表 1 は、テスト結果を要約しています。

モデル**特徴量次元テスト ROC-AUCテスト AP

Raw (baseline)130.98850.1238

Embeddings only640.87750.0123

Combined770.99250.1755

*表1. TabFormer時系列テスト分割における下流の不正検出結果。統合モデルは、生特徴ベースラインに対してROC-AUCを0.41%、APを41.76%向上させます*

統合モデルは、ベースラインに対してROC-AUCを0.41%、APを41.76%向上させます。このAPの差分が運用上の勝利です:固定された日次処理能力を持つレビューチームが、同じ負荷でより多くの不正を検出できるようになります。

埋め込み(Embeddings)はユーザーの取引履歴を符号化し予測力を提供しますが、単独の特徴として使用するとベースラインよりも性能が劣ります。統合モデルは、生テーブル行からのイベントレベルの情報と、事前学習中に学習された埋め込みからのシーケンスレベルの文脈情報を活用します。以下の図4に視覚的な比較を示します。

imageimage*図4. 3つの下流モデルのテストROC-AUCとテストAPを並べて比較した結果。統合モデル(生特徴+基盤モデル埋め込み)が両方の指標で勝利します*

開発者向け例のカスタマイズ

リポジトリは、各コンポーネントを独立して交換可能に構造化されています:**

—Tokenizer: src/tokenizer/ のパイプラインを、ステップの追加または置換によって任意のトランザクションスキーマに適応させてください。各ステップは BaseTokenizer の小さなサブクラスであるため、デバイスフィンガープリント、受益者国、商社国などの新しいフィールドをサポートするのは簡単な追加作業です。

—モデルアーキテクチャ: 学習用 YAML ファイル内の model._target_ と model.config._target_ を編集し、HuggingFace に互換性のあるデコーダーを指すようにしてください。NeMo(データローダー、FSDP2、チェックポイント、評価)を使用する残りの学習パイプラインはそのまま維持されます。

—下流タスク: XGBoost を固定長の特徴ベクトルを消費できる任意のモデルに置き換えてください。顧客離脱予測、顧客セグメンテーション、ライフタイムバリュー回帰、次善アクションランキング、与信スコアリングはいずれも、同じ埋め込みプラスヘッドのパターンに適合します。

この開発者向け例は、不正以外のラベルにも拡張可能であり、基盤的な能力を示すように設計されています。上記のステップ 5 における「Is Fraud?」を、バックボーンによってエンコードされたユーザー履歴と整合する任意のイベントラベルに置き換えてください。

はじめに

これで、生きた取引ログから下流の分類器を強化する事前学習済みファウンデーションモデルへの参照パスが完成しました。これは NVIDIA によってエンドツーエンドで加速されており、カスタムトークナイザー、トランスフォーマーデコーダーバックボーン、埋め込み駆動型 XGBoost ヘッドという 3 つのコンポーネントが組み合わさることで、TabFormer 不正検出ベンチマークにおいて強力な業界標準ベースラインに対し、近似的に 50% の AP(平均精度)向上を実現します。

NVIDIA Launchable を介して GPU 加速環境でノートブックをデプロイするか、GitHub リポジトリ を通じてご自身の環境でデプロイするには、build.nvidia.com へアクセスしてください。

原文を表示

Every swipe, transfer, and payment on a modern financial network encodes a pattern of human behavior. Transaction data is one of the richest signals an enterprise owns. Yet most production use cases for such tabular data still depend on hand-engineered features and rule sets that are brittle, expensive to maintain, and blind to the sequential structure inside a customer history.

Foundation models, pre-trained on large volumes of unlabeled transaction sequences, change this equation by producing general-purpose representations of financial behavior that transfer across a wide array of downstream tasks. A single backbone covers fraud detection, credit scoring, lifetime value prediction, segmentation, personalized recommendations, recurrent-transaction detection, and more.

The industry signal is strong and accelerating. Innovative financial firms are training transformer-based models on billions of transactions, reporting double-digit relative lifts on production-scale tasks while simultaneously streamlining operations. See Stripe’s payments foundation model, Nubank’s NuFormer, Visa’s TransactionGPT, Mastercard’s large tabular model, Revolut’s PRAGMA, Plaid’s transaction foundation model, and more.

The NVIDIA Build Your Own Transaction Model developer example walks through how to build a transaction foundation model end-to-end using accelerated computing.

You will progress through five steps in this workflow:

  • GPU-accelerated data processing with NVIDIA CUDA-X library cuDF
  • Custom tokenization with NVIDIA CUDA-X libraries cuDF and cuML
  • Transformer decoder model pretraining from scratch with NVIDIA NeMo AutoModel open library, part of NVIDIA NeMo framework
  • Extracting learned embeddings
  • Augmenting a downstream fraud classifier with embeddings

By the end, you will reproduce a near-50% lift in Average Precision (“AP”)— the area under the precision-recall curve—capturing how well the model ranks fraud across all operating thresholds), over a strong XGBoost baseline on the IBM TabFormer fraud dataset. Figure 1, below, shows the end-to-end pipeline.

Figure 1. End-to-end transaction foundation model pipeline: Raw transactions flow through a GPU-accelerated data processing and domain tokenization using NVIDIA CUDA-X libraries, a transaction foundation model pretrained using NeMo AutoModel, and embedding extraction into downstream tabular models
Figure 1. End-to-end transaction foundation model pipeline: Raw transactions flow through a GPU-accelerated data processing and domain tokenization using NVIDIA CUDA-X libraries, a transaction foundation model pretrained using NeMo AutoModel, and embedding extraction into downstream tabular models

Why transformers fit transaction histories

Large language models learn from sequences of words. During pretraining, a model sees text and learns that words, phrases, and sentences carry meaning through order and context. A transaction foundation model applies the same principle to financial behavior. A sequence such as “paycheck deposit, grocery purchase, transit fare, recurring subscription, card-present restaurant payment” carries information that no single transaction row can express alone.

Transformers are well suited to this structure because self-attention can connect events that sit far apart in history. A fraudulent transaction may only look suspicious when paired with a recent travel pattern or a sudden burst of small authorizations. Traditional tabular features can approximate these patterns, but engineers must decide which windows, aggregates, and rules to build up front. A pretrained transformer learns those relationships directly from the sequence.

This approach complements other NVIDIA financial AI workflows, including the NVIDIA AI Blueprint for financial fraud detection using graph neural networks (GNNs). GNNs capture relationships across connected entities such as accounts, merchants, devices, and transactions. Transaction foundation models focus on behavioral histories within a customer or account sequence. In practice, both methods produce rich embeddings with complementary information that pair naturally.

Load the data and set a baseline

Notebook 01_dataset_baseline.ipynb loads the IBM TabFormer dataset, roughly 24.4M synthetic card transactions with a ~0.12% fraud rate, directly into GPU memory with cuDF.

The dataset splits are partitioned temporally by cumulative transaction count: the first 80% of transactions by date is used for training; the next 10% becomes validation; and the final 10% becomes test. These splits therefore occupy disjoint and ordered time windows, preventing data leakage and reflecting real-world production environments.

With the splits in place, the notebook trains an XGBoost classifier utilizing native GPU acceleration with tree_method="hist" and device="cuda" on a 1M-row balanced training sample. Evaluation runs on a 100k stratified holdout that preserves the realistic ~0.1% fraud prevalence.

The baseline numbers set the bar for the rest of the tutorial:

  • Test ROC-AUC: 0.9885
  • Test AP: 0.1238

Pay attention to AP rather than ROC-AUC. Under 0.1% class imbalance, ROC-AUC saturates quickly and hides meaningful differences in high scoring regions. AP measures across the full recall curve and responds to improvements where they matter operationally. Every subsequent model in this tutorial is judged by AP first.

Tokenize transactions on the GPU

General-purpose LLM tokenizers waste capacity on tabular financial data. For example, a byte pair encoding (BPE) tokenizer splits a single transaction into roughly 39 subword tokens, where most encode commas and dollar signs rather than behavior. Notebook 02_seq_preproc_tokenization.ipynb introduces a custom domain tokenizer that converts each transaction into roughly 12 semantic tokens with a much smaller vocabulary (6,251 symbols vs. 50,257 from BPE).

In addition to token information density, this efficiency also enables more than 3x the number of transactions for a set token budget. Practically speaking, a model with a context window of 4,092 can fit a history of ~315 transactions from the domain tokenizer and only ~102 transactions from a BPE tokenizer.

Figure 2, below, compares token counts per transaction between the two tokenization methods on the same records.

The domain tokenizer is implemented in src/tokenizer/financial_pipeline.py. This flexible pipeline handles amount binning, merchant hashing, hour-of-day and day-of-week, month, card identity, chip type, ZIP3 and state, and customer identity. Every step runs on the GPU through cuDF.

The tokenizer can be readily adapted to different transaction schema by adding or replacing individual steps in the modular pipeline. Each step implements a small BaseTokenizer interface, so extending coverage to new fields such as device ID or beneficiary country takes just a short subclass.

Figure 2. Token efficiency comparison between the domain tokenizer (~12 tokens per transaction, 6,251-symbol vocabulary) and GPT-2 BPE (~39 tokens per transaction, 50,257-symbol vocabulary) on the same TabFormer records
Figure 2. Token efficiency comparison between the domain tokenizer (~12 tokens per transaction, 6,251-symbol vocabulary) and GPT-2 BPE (~39 tokens per transaction, 50,257-symbol vocabulary) on the same TabFormer records

Pretrain with NeMo AutoModel

NeMo AutoModel is a Pytorch-native open-source training library under the NVIDIA NeMo Framework, designed to streamline and scale training and finetuning for LLMs and VLMs.

Notebook 03_foundation_model_training.ipynb pretrains a decoder-only foundation model on the tokenized corpus using causal language modeling. The objective is simple — to predict the next token given every previous token — but the supervision signal is dense. Every position in a sequence contributes a gradient, so a single packed transaction sequence yields thousands of next-event predictions.

The model is a compact Llama decoder defined in configs/pretrain_financial_decoder.yaml:

  • ~29M parameters
  • Hidden size 512, 8 transformer layers
  • Grouped-Query Attention with 8 query heads and 2 KV heads
  • 8,192-token RoPE context window
  • SwiGLU activation, RMSNorm, domain vocabulary of 6,251 tokens

NeMo AutoModel handles the rest of the stack. Kick off a single-GPU sanity run.

python scripts/train_decoder_model.py \

--config configs/pretrain_financial_decoder.yaml \

--step_scheduler.max_steps 30

The 30-step demo drops training loss from ln(6251)≈8.74 (the random-guess baseline for this vocabulary) to around 6.0. To scale the same run to eight GPUs, simply prefix the command with torchrun --nproc-per-node=8 —no changes to the script or distributed boilerplate required. Multi-node scaling is straightforward as well. NeMo AutoModel wires up FSDP2 sharding, mixed precision, gradient accumulation, and checkpoint consolidation from the YAML.

Checkpoints land as standard safetensors files, which means the trained backbone loads with a one-liner anywhere HuggingFace Transformers is installed:

from transformers import AutoModelForCausalLM

model = AutoModelForCausalLM.from_pretrained("models/decoder-foundation-model")

The repository ships a full checkpoint trained for 3,000 steps, which Notebooks 04 and 05 load; the 30-step test is for demonstrative and validation purposes.

To swap architectures, edit model._target_ and model.config._target_ in the YAML. Any HuggingFace-compatible decoder is designed to drop in without training-code changes.

Notebook 04_inference_embedding_extraction.ipynb turns the pretrained backbone into a feature extractor. It loads the checkpoint with AutoModelForCausalLM, requests output_hidden_states=True, and pools the final hidden layer down to a 512-dim vector per user history.

For decoder-only models with causal attention, only the final position has observed the entire sequence while earlier positions are blind to later tokens. Last-token pooling therefore picks the most informative location in the sequence. The implementation in src/decoder_inference.py uses the attention mask to find the last non-pad token per row and gathers its hidden state.

The extraction loop is a single call:

embeddings = inference.extract_embeddings_batched(

padded_ids, batch_size=1024, show_progress=True

)

The notebook extracts and saves train, validation, and test embeddings as .npy files. Additionally, a metadata.json describing shapes and row alignment is saved, which is later used in Notebook 05 to join embeddings back to the associated raw tabular features.

Figure 3, below, shows a 3D UMAP projection of 50k validation embeddings, colored by merchant industry category and zip code. Visible clusters in each field confirm that the backbone has learned semantically coherent representations without ever seeing any target labels during pretraining.

![Three-dimensional scatter plot of transaction embeddings reduced to three dimensions with UMAP, showing distinct clusters corresponding to different merchant industries and user locations

](https://developer-blogs.nvidia.com/wp-content/uploads/2026/06/image6.webp)

Three-dimensional scatter plot of transaction embeddings reduced to three dimensions with UMAP, showing distinct clusters corresponding to different merchant industries and user locations
Three-dimensional scatter plot of transaction embeddings reduced to three dimensions with UMAP, showing distinct clusters corresponding to different merchant industries and user locations

*Figure 3. 3D UMAP projection of 50,000 validation-set transaction embeddings. Points colored by merchant industry and user zip code each show clear behavioral clusters in the learned representation space***

Measure lift on a downstream task

Notebook 05_xgboost_fraud_detection.ipynb answers the billion dollar question: Can transaction foundation model embeddings move downstream metrics?

It trains three GPU XGBoost classifiers and evaluates all of them on the same 100k stratified test set:

  • Raw—13 hand-engineered tabular features (the baseline from Step 1)
  • Embeddings—512-dim foundation-model vectors compressed to 64d with PCA (~78% variance retained)
  • Combined—raw features concatenated with the 64d embeddings, 77d total

Table 1, below, summarizes the test results.

The combined model lifts ROC-AUC by 0.41% and AP by 41.76% over the baseline. That AP delta is the operational win: a review team with fixed daily capacity catches materially more fraud at the same workload.

Embeddings encode the user’s transaction history and provide predictive power, but underperform the baseline as lone features. The combined model leverages event-level information from the raw tabular row and sequence-level historical context from embeddings that were learned during pretraining. Figure 4, below, shows the comparison visually.

Figure 4. Side-by-side comparison of test ROC-AUC and test AP for the three downstream models. The combined model (raw features + foundation-model embeddings) wins on both metrics
Figure 4. Side-by-side comparison of test ROC-AUC and test AP for the three downstream models. The combined model (raw features + foundation-model embeddings) wins on both metrics

Customize the developer example

The repository is structured so that each component is swappable independently: **

—Tokenizer: Adapt the pipeline in src/tokenizer/ to any transaction schema by adding or replacing steps. Each step is a small subclass of BaseTokenizer, so supporting new fields such as device fingerprint, beneficiary country, and merchant country is a short addition.

—Model architecture: Edit model._target_ and model.config._target_ in the training YAML to point at any HuggingFace-compatible decoder. The rest of the training pipeline using NeMo (data loader, FSDP2, checkpointing, evaluation) stays put.

—Downstream task: Replace XGBoost with any model that consumes fixed-length feature vectors. Churn prediction, customer segmentation, lifetime value regression, next-best-action ranking, and credit scoring all fit the same embedding-plus-head pattern.

The developer example is designed to extend to labels other than fraud as well, exhibiting foundational capabilities. Swap Is Fraud? in Step 5, above, for any event label that aligns with the user histories encoded by the backbone.

Get started

You now have a reference path from raw transaction logs to a pretrained foundation model that augments a downstream classifier, accelerated end-to-end with NVIDIA. The three components — a custom tokenizer, a transformer decoder backbone, and an embedding-driven XGBoost head — together deliver a near-50% AP lift over a strong industry standard baseline on the TabFormer fraud benchmark.

Visit build.nvidia.com to deploy the notebook in a GPU-accelerated environment via NVIDIA Launchable or your own environment via GitHub repository.

この記事をシェア

関連記事

NVIDIA Developer Blog★42026年6月17日 07:30

NVIDIA XR AI を用いた AR グラスおよび XR デバイス向け AI エージェントの構築

NVIDIA は、AR グラスや XR デバイス上で動作する AI エージェントを構築するための技術とアプローチを NVIDIA Developer Blog で発表した。

NVIDIA Developer Blog★42026年6月17日 01:00

低精度トレーニングにおけるトランスフォーマーベースモデルの最適化手法

NVIDIA は、低精度トレーニングでトランスフォーマーモデルを効率的に実行するための具体的な最適化手法をブログ記事で公開した。

Ars Technica AI★32026年6月16日 04:07

半導体メーカーNvidia、2021年以来初の債券発行で250億ドル超の調達を検討

半導体大手のNvidiaは、AIセクターへの投資意欲を試すため、米国市場で250億ドル規模の投資適格債を販売する計画である。これは同社が過去5年間で初めて行う債券発行であり、7つの異なる満期期間を設定した大規模な発行となる見込みだ。

今日のまとめ

AI日報で今日の重要ニュースをまとめ読み

ニュース一覧に戻る元記事を読む