AI Exchange Dealer: Development of an LLM-Based Forex Trader Model for Enhanced Financial Market Predictions

Exchange rate prediction is a crucial aspect of financial institutions and economic analysis, playing a vital role in market stability and investment strategy formulation. Traditional foreign exchange (FX) dealer forecasting methods often rely on empirical knowledge and conventional statistical models, which may have limitations in highly volatile market conditions.

This report introduces Exchange models developed using Meta’s Llama 3.1 (8B) and 3.2 (1B, 3B), along with Google’s Gemma 3 (12B), enhanced with SFT (Supervised Fine-Tuning) and DPO (Direct Preference Optimization) techniques. These models leverage large-scale language modeling to analyze and predict exchange rate fluctuations with high precision.

  • Exchange Model: Focuses on exchange rate prediction using LLM capabilities to analyze market volatility and forecast USD/KRW exchange rates.

This report evaluates the performance of these models in comparison to traditional forecasting approaches, validating their practical applicability.

Model Architecture & Training

The Exchange models are built on Meta’s Llama 3.1, 3.2, and Google’s Gemma 3 architectures. SFT (Supervised Fine-Tuning) and DPO (Direct Preference Optimization) techniques were applied to maximize exchange rate prediction performance.

Model Information

Exchange Model Base Model Base Model Release Date Context Length License
Exchange-1B meta-llama/Llama-3.2-1B-Instruct 2024/09/25 128k llama 3.2
Exchange-3B meta-llama/Llama-3.2-3B-Instruct 2024/09/25 128k llama 3.2
Exchange-8B meta-llama/Llama-3.1-8B-Instruct 2024/07/23 128k llama 3.1
Exchange-12B google/gemma-3-12b-it 2025/03/12 128k gemma

Training Techniques

  • SFT (Supervised Fine-Tuning): Trained on diverse market data to improve the model's predictive accuracy, allowing for a more precise reflection of exchange rate fluctuation patterns.
  • DPO (Direct Preference Optimization): Optimized the model's predictions based on user preferences to enhance usability in practical scenarios.

By applying these techniques, Exchange models have evolved into highly reliable and precise exchange rate prediction models, outperforming traditional forecasting methods.

Model Input & Output

The Exchange models predict the next day's exchange rates (High, Low, Close) based on financial data and economic news. By integrating diverse financial data sources, they enhance prediction accuracy and provide more reliable analytical results compared to traditional methods.

Input Data

The models utilize financial data and economic news from the past four days to predict exchange rates. By incorporating diverse data types, they improve prediction precision and analytical reliability.

Prompt

The Exchange models use a specific prompt format depending on the currency for which the prediction is desired. The prompt is designed to effectively utilize input data, including key economic indicators, exchange rate data, and financial news, enabling the model to make more accurate and reliable predictions.

주어진 다양한 금융 데이터와 뉴스 내용을 통해 24시간 USD 환율 데이터를 예측하시오. CSV 형식으로 Date,Name,Open,High,Low,Close으로 예측 결과를 제공하시오.

Exchange Rate Data

Exchange rate data is used as a fundamental input, and the model receives daily exchange rate information for USD/KRW from the past 4 days. The data is provided in CSV format, including the columns Date, Name, Open, High, Low, and Close, and is sorted in ascending order by the latest date.

## USD Data
Date,Name,Open,High,Low,Close
2025-02-24,USD,1433.0,1436.7,1423.8,1428.4
2025-02-25,USD,1428.4,1435.0,1426.7,1433.1
2025-02-26,USD,1433.1,1436.4,1428.9,1436.3
2025-02-27,USD,1436.3,1447.3,1432.9,1446.3

Key Economic Indicator Data

The model utilizes various key economic indicator data related to the foreign exchange market, such as KOSDAQ, DOW. By integrating these additional data points along with exchange rate data during training, the model can make more precise predictions compared to using exchange rate data alone.

The data is categorized into groups such as KOSDAQ, DOW, and includes the price fluctuation information of key assets from the past 4 days. The data is provided in CSV format with the columns Date, Name, Open, High, Low, Close, and Volume, and is sorted in ascending order by the latest date.

## DOW Data
Date,Name,Open,High,Low,Close
2025-02-24,DOW,43493.1,43649.3,43343.7,43467.0
2025-02-25,DOW,43467.0,43734.4,43302.6,43313.6
2025-02-26,DOW,43313.6,43858.7,43283.0,43813.8
2025-02-27,DOW,43813.8,43879.9,43318.9,43809.3

## KOSDAQ Data
Date,Name,Open,High,Low,Close
2025-02-24,KOSDAQ,766.9,772.5,764.5,766.8
2025-02-25,KOSDAQ,766.8,773.9,765.3,769.0
2025-02-26,KOSDAQ,769.0,774.2,766.7,774.1
2025-02-27,KOSDAQ,774.1,776.6,760.1,760.1

News Data

Simple numerical data alone may have limitations in predicting exchange rates. Therefore, to improve prediction accuracy, we integrate relevant news data that reflects major economic issues. The news data includes daily summaries of global economic news, changes in key economic indicators, asset market trends, policy announcements, and geopolitical issues that could influence exchange rate fluctuations.

The input news consists of both the original articles and summaries. News from the day before the prediction is input as the article titles, while news from the previous 4 days, including the day before, is summarized. The news data is entered with the article from the previous day first, followed by the summarized articles from older dates. The format of the news data is as follows.

## 2025-02-27 USD News
Dollar bolstered as Trump's mixed tariff messages stir uncertainty
The U.S. dollar firmed above an 11-week trough on Thursday as vague pledges from U.S. President Donald Trump to impose tariffs on Europe and further delays...
The People's Bank of China decided on Thursday morning to set the exchange rate of the yuan against the US dollar at 7.1740 yuan per dollar,...
EUR/USD: Euro remains on hold below 1.0500 level as Trump's imposition of tariffs on EU was no surprise
## 2025-02-27 KRW News
코스피 0.73% 하락...원/달러 환율 0.67% 상승 마감
[서울=뉴스핌] 양윤모 기자 = 27일 오후 코스피 지수가 전 거래일 종가보다 19.34포인트(0.73%) 내린 2,621.75로, 코스닥 지수는 0.56포인트(0.07%) 내린 770.85로...
트럼프 ‘EU 관세’ 발언에… 원·달러 환율, 9.9원 오른 1443원 마감 - 조선비즈
## 2025-02-27 KOSDAQ News
코스피 하락 출발·코스닥 상승 출발
어제 미국 경제 우려에도 3거래일 만에 반등한 코스피는 오늘은 하락 출발했습니다....
코스닥, 외인과 기관 매도에 하락 마감...클래시스, HLB 상승 VS 에코프로비엠, 에코프로 하락
## 2025-02-27 Gold News
- **금, 은 가격 하락**: 2월 27일 기준 국제 금값과 은값이 약세를 보이며 각각 $2900/온스 아래로 떨어짐. 달러 강세와 인플레이션 데이터 등 경제 요인들이 영향.
- **금값 변동과 투자자 주목**: MCX 금 선물은 최근 11거래일 동안 좁은 범위에 머물렀으며, 향후 추세는 주요 경제 데이터와 글로벌 시장 변화에 따라 달라질 전망.
## 2025-02-27 Oil News
- **원유 시장:** 미국의 클레론 베네수엘라 면허 취소로 원유 공급 우려가 커지며 유가 상승.
- **팜유 및 대두:** 팜유는 약세 전망과 경쟁 오일 가격 하락으로 하락, 대두 또한 수요 약화로 약세.
- **면화 및 목화씨유:** 면화 가격은 반등했지만 목화씨유는 수요 약화로 하락세.
... 

Output Data

The model predicts the exchange rates for the next day based on the provided data. The prediction results are output in CSV format, including the following columns: Date, Name, Open, High, Low, Close.

Date,Name,Open,High,Low,Close
2025-02-28,USD,1446.3,1463.8,1445.4,1461.8

Evaluation

All evaluations were conducted using USD/KRW exchange rate data from Yahoo Finance.

Ranking

Ranking refers to the process of listing multiple values to assess their relative magnitude. During March 2025, the accuracy of the High and Low values predicted by other banks and Exchange for USD exchange rates was calculated to determine rankings. The accuracy for High and Low values was determined by calculating the average MAPE (Mean Absolute Percentage Error) for each and using it to rank the predictions. The MAPE for the model represents the average of 4 runs conducted in different environments. MAPE calculates the average error between the predicted and actual exchange rates as a percentage, where a lower value indicates higher prediction accuracy.

The Rank column represents each Site accuracy ranking based on MAPE values. The Site column lists the names of various banking sites and models providing exchange rate predictions. The date-specific columns show the average MAPE for High and Low values calculated for each date, and the Average column presents the overall mean of these values. The date columns contain only the dates for which all sites provided prediction results.

Rank Site Average 03/05 03/06 03/07 03/11 03/12 03/13 03/14 03/19 03/20 03/21 03/25 03/26 03/27 03/28
1 Exchange-12B (Ours) 0.17 0.4 0.09 0.05 0.36 0.05 0.1 0.19 0.32 0.09 0.05 0.16 0.14 0.29 0.15
1 Korea Trade Insurance Corp. 0.17 0.23 0.13 0.11 0.26 0.08 0.11 0.16 0.41 0.32 0.13 0.11 0.06 0.13 0.14
3 Shinhan Bank 0.19 0.23 0.23 0.21 0.26 0.13 0.09 0.19 0.28 0.24 0.28 0.14 0.1 0.09 0.17
3 Woori Bank 0.19 0.23 0.19 0.28 0.22 0.13 0.12 0.15 0.45 0.3 0.11 0.04 0.13 0.14 0.17
3 KOOKMIN BANK 0.19 0.23 0.09 0.24 0.26 0.07 0.16 0.19 0.42 0.3 0.14 0.14 0.1 0.21 0.17
6 iM Bank 0.2 0.23 0.09 0.25 0.33 0.13 0.16 0.19 0.42 0.26 0.14 0.13 0.06 0.21 0.17
7 Exchange-8B (Ours) 0.21 0.46 0.16 0.16 0.14 0.27 0.13 0.18 0.41 0.3 0.22 0.1 0.08 0.23 0.12
8 Toss Securities 0.22 0.13 0.2 0.31 0.22 0.13 0.19 0.33 0.42 0.27 0.22 0.21 0.13 0.19 0.09
8 KEB Hana Bank 0.22 0.23 0.09 0.25 0.46 0.13 0.16 0.19 0.55 0.37 0.14 0.21 0.1 0.09 0.17
10 Exchange-3B (Ours) 0.23 0.43 0.2 0.21 0.2 0.16 0.14 0.19 0.33 0.21 0.18 0.32 0.2 0.26 0.2
11 Exchange-1B (Ours) 0.27 0.61 0.25 0.16 0.47 0.47 0.12 0.22 0.29 0.32 0.21 0.11 0.15 0.15 0.17

Comparison of Evaluation Results Using Different Exchange Rate Sources

To evaluate the model’s performance under varying data conditions, we compare results using exchange rate data from Yahoo Finance, KEB Hana Bank, and SMBS(Seoul Money Brokerage Services). The Yahoo Finance, KEB Hana Bank, and SMBS columns represent the average MAPE for High and Low values calculated using each respective data source. The Average column represents the overall average MAPE across all data sources.

Rank Site Average Yahoo Finance KEB Hana Bank SMBS
1 Korea Trade Insurance Corp. 0.18 0.17 0.19 0.18
2 Exchange-12B (Ours) 0.19 0.17 0.21 0.2
3 Shinhan Bank 0.2 0.19 0.2 0.2
4 iM Bank 0.21 0.2 0.23 0.21
4 KOOKMIN BANK 0.21 0.19 0.23 0.21
4 Woori Bank 0.21 0.19 0.23 0.21
7 Exchange-8B (Ours) 0.22 0.21 0.24 0.22
8 Exchange-3B (Ours) 0.23 0.23 0.23 0.23
8 KEB Hana Bank 0.23 0.22 0.23 0.24
8 Toss Securities 0.23 0.22 0.24 0.23
11 Exchange-1B (Ours) 0.25 0.25 0.26 0.24

Accuracy

Accuracy is a metric used to assess how close the predicted values are to the actual values, and the accuracy is determined by calculating the MAPE. Since other bank sites do not provide Close values, only the exchange model was used to calculate the average MAPE for High, Low, and Close values for each currency and assess the accuracy.

Model Average 03/05 03/06 03/07 03/11 03/12 03/13 03/14 03/19 03/20 03/21 03/25 03/26 03/27 03/28
Exchange-12B 0.24 0.68 0.08 0.14 0.42 0.05 0.19 0.13 0.52 0.15 0.05 0.12 0.27 0.36 0.28
Exchange-8B 0.25 0.62 0.19 0.23 0.12 0.31 0.11 0.23 0.53 0.4 0.22 0.14 0.06 0.26 0.14
Exchange-3B 0.27 0.58 0.2 0.26 0.24 0.16 0.12 0.15 0.5 0.27 0.26 0.35 0.16 0.3 0.23
Exchange-1B 0.31 0.77 0.27 0.23 0.56 0.48 0.11 0.21 0.4 0.3 0.26 0.22 0.19 0.17 0.17

Robustness

Robustness refers to a model’s ability to perform reliably under various environmental changes and exceptional situations. In other words, it reflects the capability to maintain performance despite uncertainties, noise, errors, or unexpected changes in the data. In the Input Data section, we introduced the input datasets used in our analysis. However, this does not imply that the selected combination is optimal. To evaluate the model’s robustness, we systematically modified the input data and examined its effects.

To assess robustness, we applied various data transformation methods to exchange rate predictions for March 2025. Specifically, we analyzed changes in MAPE by adjusting the input window size and evaluating the effect of removing specific data types.

Impact of Input Window Size

By default, the models predict the next day's exchange rate using data and news from the past four days. To evaluate robustness, we varied the input range from one to six days and analyzed the corresponding changes in MAPE.

Among the models, Exchange-12B exhibited the highest robustness, maintaining stable performance across different input lengths with minimal MAPE fluctuations, while other models showed more variation depending on the input window size. A 2- to 4-day input window yielded the lowest average MAPE (0.22), suggesting that this range is optimal for Exchange models. These findings highlight the importance of selecting an appropriate input length to enhance accuracy while ensuring robustness across different model sizes.

Model \ Days 1 2 3 4* 5 6
Exchange-12B 0.15 0.17 0.17 0.17 0.18 0.22
Exchange-8B 0.22 0.21 0.23 0.21 0.28 0.29
Exchange-3B 0.31 0.24 0.26 0.23 0.3 0.57
Exchange-1B 0.39 0.26 0.24 0.27 0.23 0.24
Average 0.27 0.22 0.22 0.22 0.25 0.33

* default days


Impact of Removing Specific Data Types

To analyze the impact of different data compositions on prediction accuracy, we adopted a setting called Complete Removal, where a specific indicator was excluded from the entire input data. The input data consists of the USD/KRW exchange rate, financial indicators (such as stock indices like DOW, commodity prices like Gold, and market indices like KOSDAQ), as well as related news and news summaries. Since the goal is to predict USD exchange rates, USD/KRW exchange rate data and USD-related news were always included in all experiments.

The table presents the impact of completely removing specific financial indicators from the input data on model performance. Each value represents the mean MAPE (High, Low) for different indicator exclusion scenarios across the Exchange models.

Interestingly, some cases show a lower MAPE after removing certain indicators, suggesting that specific combinations may introduce unnecessary noise rather than enhancing predictive accuracy. The accuracy exhibits sensitive to input composition changes. The optimal combination of indicators may vary across model sizes, highlighting the complexity of selecting the most effective input features.

Included Indicators Exchange-1B Exchange-3B Exchange-8B Exchange-12B
USD Gold 0.17 0.23 0.15 0.17
USD DOW Oil KRW 0.17 0.17 0.2 0.17
USD DOW KOSDAQ Gold KRW 0.2 0.21 0.17 0.16
USD 0.17 0.23 0.21 0.15
USD KRW 0.21 0.2 0.21 0.15
USD Gold KRW 0.21 0.19 0.15 0.19
USD DOW Oil Gold 0.16 0.25 0.18 0.17
USD DOW KRW 0.21 0.21 0.21 0.16
USD KOSDAQ Gold 0.2 0.24 0.19 0.18
USD KOSDAQ Oil 0.18 0.23 0.22 0.17
USD Oil Gold 0.17 0.18 0.26 0.2
USD Oil KRW 0.21 0.22 0.2 0.17
USD DOW Gold KRW 0.17 0.23 0.18 0.2
USD DOW KOSDAQ Oil 0.22 0.2 0.22 0.18
USD KOSDAQ Gold KRW 0.21 0.23 0.22 0.15
USD DOW KOSDAQ Oil Gold 0.21 0.2 0.23 0.17
USD DOW Oil Gold KRW 0.17 0.26 0.17 0.18
USD KOSDAQ Oil Gold KRW 0.24 0.17 0.21 0.17
USD DOW 0.18 0.26 0.22 0.17
USD Oil 0.22 0.21 0.17 0.23
USD DOW Oil 0.22 0.18 0.25 0.19
USD DOW KOSDAQ KRW 0.21 0.28 0.18 0.17
USD KOSDAQ Oil KRW 0.24 0.23 0.23 0.15
USD Oil Gold KRW 0.23 0.21 0.23 0.17
USD KOSDAQ 0.2 0.24 0.23 0.21
USD DOW Gold 0.23 0.23 0.26 0.18
USD KOSDAQ KRW 0.2 0.26 0.22 0.19
USD DOW KOSDAQ Gold 0.28 0.24 0.19 0.16
USD KOSDAQ Oil Gold 0.24 0.23 0.21 0.18
USD DOW KOSDAQ Oil KRW 0.23 0.22 0.27 0.17
USD DOW KOSDAQ Oil Gold KRW* 0.27 0.23 0.21 0.17
USD DOW KOSDAQ 0.21 0.28 0.21 0.21

* default Included Indicators


Conclusion

The Exchange models demonstrated performance comparable to that of traditional foreign exchange dealers in predicting exchange rates, highlighting the effectiveness of LLM-based data processing and training techniques. By integrating diverse financial data and news information, these models capture market volatility more effectively, enhancing the reliability of exchange rate forecasts. Among the different Exchange models, the 12B model demonstrated particularly strong performance and robustness. This study demonstrates the practical viability of AI-driven financial forecasting.

Moving forward, we plan to further improve model performance by integrating additional datasets and financial indicators, reinforcing AI’s role as a powerful decision-making tool in financial markets.

Appendix

Prediction Data

We present the High and Low prediction values for each bank and model, based on data from March 2025. The table below presents the daily predictions for USD exchange rates (High, Low) made by various banks and the Exchange model, which were used in the evaluation. Note that sites only provide predictions for the High and Low values. Since the Evaluation section reports the average results from running the Exchange models in various environments, the MAPE calculated using this dataset may differ from the reported values.

High

Date Exchange-12B Exchange-1B Exchange-3B Exchange-8B KEB Hana Bank iM Bank KOOKMIN BANK Korea Trade Insurance Corp. Shinhan Bank Toss Securities Woori Bank
03/05 1463.9 1465.2 1460 1462.5 1459 1457.0 1458 1457.8 1458.0 1458.0 1457
03/06 1450.1 1453 1449.9 1445.7 1448 1449.0 1449 1446.6 1445.0 1447.0 1445
03/07 1448.4 1446.8 1452.2 1445.8 1453 1453.0 1447 1450.8 1452.0 1455.0 1453
03/11 1466.5 1458.9 1458.9 1465.5 1467 1465.0 1464 1463.8 1464.0 1463.0 1463
03/12 1456.5 1465.7 1458.2 1466.8 1456 1457.0 1455 1455.8 1457.0 1455.0 1454
03/13 1455.2 1454.5 1459.1 1455.1 1455 1455.0 1455 1455.2 1456.0 1455.0 1454
03/14 1456.8 1456.8 1458.4 1457 1458 1459.0 1460 1458.4 1458.0 1459.0 1459
03/19 1453.9 1453.7 1455 1453.7 1452 1454.0 1453 1453.6 1455.0 1455.0 1453
03/20 1468.2 1461.8 1468 1464 1462 1464.0 1462 1462.2 1465.0 1463.0 1462
03/21 1469 1469.2 1472.1 1473 1472 1472.0 1471 1471 1474.0 1475.0 1470
03/25 1469.4 1469.6 1473.7 1475.2 1470 1474.0 1473 1471.6 1474.0 1470.0 1472
03/26 1466.9 1468.3 1469 1466.7 1470 1467.0 1470 1468.4 1470.0 1469.0 1465
03/27 1466.5 1472.9 1466.5 1474.8 1473 1474.0 1475 1473.6 1473.0 1473.0 1473
03/28 1468.2 1469.2 1471.2 1472.1 1468 1468.0 1467 1468 1468.0 1470.0 1467

Low

Date Exchange-12B Exchange-1B Exchange-3B Exchange-8B KEB Hana Bank iM Bank KOOKMIN BANK Korea Trade Insurance Corp. Shinhan Bank Toss Securities Woori Bank
03/05 1451.4 1457 1454.8 1451.3 1449 1447.0 1448 1447.8 1448.0 1445.0 1447
03/06 1440.1 1440.5 1441.2 1438.9 1438 1439.0 1439 1437.8 1436.0 1435.0 1438
03/07 1440 1440.4 1437 1440.5 1443 1443.0 1435 1440.6 1439.0 1443.0 1444
03/11 1454.4 1452.5 1449 1452.7 1457 1455.0 1454 1454.4 1454.0 1454.0 1454
03/12 1448.8 1461.1 1446.4 1445.8 1446 1447.0 1447 1447.2 1447.0 1445.0 1446
03/13 1448.9 1448.7 1449.4 1447.8 1445 1445.0 1445 1446.2 1446.0 1444.0 1447
03/14 1446.9 1447 1449.2 1447.4 1448 1449.0 1450 1449.2 1448.0 1445.0 1450
03/19 1446.9 1448.2 1444.9 1448.9 1442 1444.0 1445 1444.6 1447.0 1443.0 1444
03/20 1454 1458 1459.8 1451.6 1452 1455.0 1454 1453.2 1453.0 1454.0 1454
03/21 1461.9 1456.6 1459.9 1457.3 1462 1462.0 1463 1462.6 1464.0 1460.0 1463
03/25 1461.9 1464.7 1459.7 1466.5 1460 1466.0 1463 1462.4 1464.0 1460.0 1465
03/26 1456.8 1460.9 1458.3 1463.5 1460 1459.0 1460 1459.6 1460.0 1458.0 1459
03/27 1458.8 1463.7 1459.3 1461.7 1463 1466.0 1465 1464 1463.0 1460.0 1465
03/28 1458.4 1464.7 1456.9 1463.8 1458 1458.0 1459 1458.8 1458.0 1460.0 1459