Submitted:
17 November 2025
Posted:
19 November 2025
You are already at the latest version
Abstract
Keywords:
1. Introduction
2. Mathematical Model of the TEG
2.1. Definition of Parameters and Variables
2.2. Transient Regime Analysis
2.3. Stationary Regime Analysis
2.3.1. Energy Balance Equations
- Function 1, balance at :
- Function 2, balance at :
- Function 3, balance at :
- Function 4, balance at :
2.3.2. Solving Nonlinear Equations
3. FT Methodology
- Merging: A script, merge.py [21], was created to combine the weights of the original JanV1-4B base model with those of the LoRA adapter. The result is a complete merged expert model in the Hugging Face standard format [23]. This yields a single model containing both the general knowledge and the new specialization.
- GGUF Conversion & Quantization: To make the model practical and fast for inference in real-world use, we converted it to GGUF format using the tools from the open-source project llama.cpp [22]. During this step, 4-bit quantization was also applied, a process that drastically reduces file size and RAM usage with minimal loss of precision. The result is a single file with the .gguf extension, optimized for efficient execution on both CPUs and GPUs.
- Qualitative evaluation: This involves interacting directly with the model, just as a human expert would. We ask complex questions and evaluate the coherence, technical accuracy, and style of its responses. It is a subjective but fundamental test.
- Advanced evaluation: To ensure the highest quality of the expert model, a rigorous dual evaluation process is implemented that surpasses traditional metrics. First, a qualitative evaluation is performed, where human subject matter experts review the model's responses to validate their technical accuracy, consistency, and practical utility in real-world scenarios. Next, a cutting-edge technique known as LLM-as-a-Judge [25,26] is applied. In this step, state-of-the-art language models GPT-4 [25] and Gemini 1.5 Pro [26] are used to act as impartial evaluators, scoring the expert model's responses based on their quality, relevance, and correctness. This combined approach provides a much deeper and more nuanced assessment than traditional automated metrics [27], as it is able to analyze the reasoning and semantic quality of the responses, not just word matching.
4. Dataset Definition
5. Results and Discussion
5.1. Analysis by Level of Difficulty
- Level 1: Formulation. Questions that require the direct formulation of heat balance equations for a single node. Questions 1, 2, 8, 9 and 11.
- Level 2: Application of models. Questions that involve combining multiple heat flows, handling thermoelectric interactions, or simplifying equations under new conditions. Questions 3 to 7.
- Level 3: Qualitative & Design reasoning. Questions that require a conceptual analysis of design trade-offs, without complex numerical calculations. Questions 10 and 12.
- Level 4-5: Quantitative & Critical analysis. Questions that require numerical calculations, interpretation of tabulated data, and decision-making based on multidimensional analysis. Questions 13 to 16.
5.1.1. Level 1: Formulation
5.1.2. Level 2: Application of Models
5.1.3. Level 3: Qualitative & Design Reasoning
5.1.4. Level 4 and 5: Quantitative & Critical Analysis
- Actual target values: , , ,
5.2. TEG FT Models vs. Generalist LLMs
- 1.
- General knowledge is insufficient, as very powerful general-purpose models like Llama3-8B and Mistral-7B —which have almost twice as many parameters as our JanV1-4B-expert-TEG model— fail spectacularly with a success rate of less than 8%, demonstrating that they lack the necessary knowledge in the specialized TEG domain. This demonstrates the need for the FT. The execution times in the two cases are less than 22 and 24 s per answer, respectively (see Table 7).
- 2.
- The Qwen3-4B-Thinking-2507 model stands out from other base models, with an impressive 76.2% accuracy rate. This suggests that its original training already included a significant amount of scientific and technical data, giving it a huge starting advantage. The drawback is its long run time, averaging 300 s per answer (see Table 7).
- 3.
-
The FT we apply in this work represents a leap towards excellence:
- ○
- The JanV1-4B-expert-TEG model improved from a low base 30.95% to 81.0%, an increase of 50 percentage points, a massive leap that demonstrates the quality of the dataset used.
- ○
- The Qwen3-4B-Thinking-2507-TEG model improved upon an already very strong foundation of 76.2%, reaching 82.9%, an increase of 6.7 percentage points. Although the leap is smaller, it is significant, as it refines and specializes existing knowledge, correcting errors and adding nuances.
- 4.
-
The speed dilemma is a fundamental factor to be analyzed. The speed comparison between the two best FT models, which are the ones trained in this work, remains a key point:
- ○
- The JanV1-expert-TEG model offers the best ratio between speed and accuracy, being fast (231 s/response) and very accurate (81.0%).
- ○
- The Qwen3-4B-Thinking-2507-TEG model is the most accurate (82.9%), but the time cost is high, at 486 s per answer. This is double the answer time of the previous model.
- ○
- Therefore, for this reason, JanV1-4B-expert-TEG achieved a better expert-level competence in the complex domain of TEGs.
5.3. Experimental Design of the TEG and LLM Strategies
5.3.1. Level 3: Qualitative & Design Reasoning
- Two are located near the hot flow inlet in the upper ceramic of the Peltier cell and in the lower ceramic.
- Two are located near the outlet on the upper ceramic and on the lower ceramic.
5.3.2. Analysis of Results and Recommendations from the LLM
- The temperatures on the cold lower face of the cells are practically identical at the inlet and outlet, ≈ .
- However, the temperatures on the hot upper face show a significant temperature gradient, > , which is undesirable for the optimal operation of the generator.
- Scenario 1: Thermal management strategies to correct the observed non-uniform flow.
- Scenario 2: Limitations of electrical optimization against fixed thermal gradients.
- Side thermal diffusers: High conductivity plates over the inlet cells to redistribute heat.
- Vertical thermal bridges: Conductive strips between rows to balance temperatures.
- Improved high conductivity thermal interface material (TIM) to reduce thermal resistance.
- Central thermal bus: A central copper plate to act as a thermal equalizer.
- Heat sink optimization: Modify its geometry to achieve uniformly distributed contact points.
6. Conclusions
Author Contributions
Funding
Acknowledgments
Conflicts of Interest
References
- Gao, Y.; Xiong, Y.; Gao, X.; Jia, K.; Pan, J.; Bi, Y.; Dai, Y.; Sun, J.; Wang, M.; Wang, H. Retrieval-Augmented Generation for Large Language Models: A Survey, 2024. https://arxiv.org/abs/2312.10997.
- Sanin-Villa, D. Recent Developments in Thermoelectric Generation: A Review. Sustainability 2022, 14 (24). [CrossRef]
- Milić, D.; Prijić, A.; Vračar, L.; Prijić, Z. Characterization of Commercial Thermoelectric Modules for Application in Energy Harvesting Wireless Sensor Nodes. Appl. Therm. Eng. 2017, 121, 74–82. [CrossRef]
- Niu, W.; Cao, X. Thermoelectric Field Analysis of Trapezoidal Thermoelectric Generator Based on the Explicit Analytical Solution of Annular Thermoelectric Generator. Energies 2023, 16 (8). [CrossRef]
- Marjanović, M.; Prijić, A.; Randjelović, B.; Prijić, Z. A Transient Modeling of the Thermoelectric Generators for Application in Wireless Sensor Network Nodes. Electronics 2020, 9 (6). [CrossRef]
- Team, J. Jan-v1-4B. Hugging Face, 2024. Available online: https://huggingface.co/janhq/Jan-v1-4B (accessed on 3 November 2025).
- Houlsby, S., N. ,. Giurgiu, A. ,. Jastrzebski, S. ,. Morrone, B. ,. De Laroussilhe, Q. ,. Gesmundo, A. ,. Attariyan, M. ,. &. Gelly. Parameter-Efficient Transfer Learning for NLP. In Proceedings of the 36th International Conference on Machine Learning (ICML), 2019. Available online: http://proceedings.mlr.press/v97/houlsby19a.html (accessed on 3 November 2025).
- Lialin, V.; Deshpande, V.; Yao, X.; Rumshisky, A. Scaling Down to Scale Up: A Guide to Parameter-Efficient Fine-Tuning, 2024. https://arxiv.org/abs/2303.15647.
- Dettmers, T.; Pagnoni, A.; Holtzman, A.; Zettlemoyer, L. QLoRA: Efficient Finetuning of Quantized LLMs, 2023. https://arxiv.org/abs/2305.14314.
- Hu, E. J.; Shen, Y.; Wallis, P.; Allen-Zhu, Z.; Li, Y.; Wang, S.; Wang, L.; Chen, W. LoRA: Low-Rank Adaptation of Large Language Models, 2021. https://arxiv.org/abs/2106.09685.
- Kirkpatrick, J.; Pascanu, R.; Rabinowitz, N.; Veness, J.; Desjardins, G.; Rusu, A. A.; Milan, K.; Quan, J.; Ramalho, T.; Grabska-Barwinska, A.; Hassabis, D.; Clopath, C.; Kumaran, D.; Hadsell, R. Overcoming Catastrophic Forgetting in Neural Networks. Proc. Natl. Acad. Sci. 2017, 114 (13), 3521–3526. [CrossRef]
- Zhou, C.; Liu, P.; Xu, P.; Iyer, S.; Sun, J.; Mao, Y.; Ma, X.; Efrat, A.; Yu, P.; Yu, L.; Zhang, S.; Ghosh, G.; Lewis, M.; Zettlemoyer, L.; Levy, O. LIMA: Less Is More for Alignment, 2023. https://arxiv.org/abs/2305.11206.
- Zhang, D.; Song, L.; Wang, L.; Li, X.; Chang, X.; Wu, P. A Systematic Review and Analysis of MPPT Techniques for TEG Systems Under Nonuniform Temperature Distribution. Front. Energy Res. 2022, Volume 10-2022. [CrossRef]
- Feng, Y.; Chen, L.; Meng, F.; Sun, F. Influences of the Thomson Effect on the Performance of a Thermoelectric Generator-Driven Thermoelectric Heat Pump Combined Device. Entropy 2018, 20 (1). [CrossRef]
- Sanin-Villa, D.; Monsalve-Cifuentes, O. D.; Henao-Bravo, E. E. Evaluation of Thermoelectric Generators under Mismatching Conditions. Energies 2021, 14 (23). [CrossRef]
- Dalola, S.; Ferrari, M.; Ferrari, V.; Guizzetti, M.; Marioli, D.; Taroni, A. Characterization of Thermoelectric Modules for Powering Autonomous Sensors. IEEE Trans. Instrum. Meas. 2009, 58 (1), 99–107. [CrossRef]
- Cataldo, R. L.; Bennett, G. L. U.S. Space Radioisotope Power Systems and Applications: Past, Present and Future. (accessed on 3 November 2025).
- Fundamental Algorithms for Scientific Computing in Python-2 025. Available online: https://scipy.org/es/ (accessed on 3 November 2025).
- Han, M., D. ,. &. Han. Unsloth: 2x Faster & Less Memory LLM Finetuning (Versión 2025.9.4) [Software]. Unsloth AI, 2024. Available online: https://github.com/unslothai/unsloth (accessed on 3 November 2025).
- Yang, A.; et al. Qwen2 Technical Report, 2024. https://arxiv.org/abs/2407.10671.
- Monzón-Verona, J. M.; García-Alonso, S.; Santana-Martín, F. J. Software and Dataset for Fine-Tuning a Local LLM for Thermo-Electric Generators with QLoRA: From Generalist to Specialist, 2025.
- Gerganov, G. Llama.Cpp: Inference of LLaMA Model in Pure C/C++ [Software]. GitHub, 2023. Available online: https://github.com/ggerganov/llama.cpp (accessed on 3 November 2025).
- Team, H. F. Hugging Face Is Way More Fun with Friends and Colleagues. Available online: https://huggingface.co/ (accessed on 3 November 2025).
- Team, O. Ollama: Run Large Language Models Locally, 2023. Available online: https://ollama.com (accessed on 3 November 2025).
- Team, O. OpenAI, Hello GPT-4o, 2024. Available online: https://openai.com/index/hello-gpt-4o/ (accessed on 3 November 2025).
- Team, G. Google,Gemini 1.5: Unlocking Multimodal Understanding across Long Contexts, 2024. Available online: (accessed on 3 November 2025).
- Lin, C.-Y. ROUGE: A Package for Automatic Evaluation of Summaries. In Text Summarization Branches Out: Proceedings of the ACL-04 Workshop (Pp. 74–81). Association for Computational Linguistics, 2004. Available online: (accessed on 3 November 2025).
- Zoui, M. A.; Bentouba, S.; Stocholm, J. G.; Bourouis, M. A Review on Thermoelectric Generators: Progress and Applications. Energies 2020, 13 (14). [CrossRef]
- Twaha, S.; Zhu, J.; Yan, Y.; Li, B. A Comprehensive Review of Thermoelectric Technology: Materials, Applications, Modelling and Performance Improvement. Renew. Sustain. Energy Rev. 2016, 65, 698–726. [CrossRef]
- Gharsallah, M.; Serrano-Sánchez, F.; Nemes, N. M.; Mompeán, F. J.; Martínez, J. L.; Fernández-Díaz, M. T.; Elhalouani, F.; Alonso, J. A. Giant Seebeck Effect in Ge-Doped SnSe. Sci. Rep. 2016, 6 (1), 26774. [CrossRef]
- Chen, T.; Shao, Y.; Feng, R.; Zhang, J.; Wang, Q.; Dong, Y.; Ma, H.; Sun, B.; Ao, D. Enhancing the Thermoelectric Performance of N-Type PbTe via Mn Doping. Materials 2025, 18 (5). [CrossRef]
- Cho, J.-Y.; Siyar, M.; Jin, W. C.; Hwang, E.; Bae, S.-H.; Hong, S.-H.; Kim, M.; Park, C. Electrical Transport and Thermoelectric Properties of SnSe–SnTe Solid Solution. Materials 2019, 12 (23). [CrossRef]
- Zhao, C.; Wang, M.; Liu, Z. Research Progress on Preparation Methods of Skutterudites. Inorganics 2022, 10 (8). [CrossRef]
- Xu, L.; Li, X.; Lu, X.; Collignon, C.; Fu, H.; Koo, J.; Fauqué, B.; Yan, B.; Zhu, Z.; Behnia, K. Finite-Temperature Violation of the Anomalous Transverse Wiedemann-Franz Law. Sci. Adv. 2020, 6 (17), eaaz3522. [CrossRef]
- Holland, J. H. Adaptation in Natural and Artificial Systems: An Introductory Analysis with Applications to Biology, Control, and Artificial Intelligence; MIT press, 1992.
- Goldberg, D. E.; Richardson, J. Genetic Algorithms with Sharing for Multimodal Function Optimization. In Proceedings of the Second International Conference on Genetic Algorithms; 1987; pp 41–49.
- Storn, R.; Price, K. Differential Evolution – A Simple and Efficient Heuristic for Global Optimization over Continuous Spaces. J. Glob. Optim. 1997, 11 (4), 341–359. [CrossRef]
- Endres, S. C.; Sandrock, C.; Focke, W. W. A Simplicial Homology Algorithm for Lipschitz Optimisation. J. Glob. Optim. 2018, 72 (2), 181–217. [CrossRef]
- Team, M. Mistral: LLM in Hugging Face. Available online: https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3 (accessed on 3 November 2025).
- Team, H. F. Llama-3.1-8B-Instruct: LLM in Hugging Face. Available online: https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct (accessed on 3 November 2025).
- Team, Q. Qwen3-4B-Thinking-2507: LLM. Available online: https://huggingface.co/Qwen/Qwen3-4B-Thinking-2507 (accessed on 3 November 2025).
- Team, Q. Qwen2.5-VL, 2025. https://qwenlm.github.io/blog/qwen2.5-vl/.
- Rein, D.; Hou, B. L.; Stickland, A. C.; Petty, J.; Pang, R. Y.; Dirani, J.; Michael, J.; Bowman, S. R. GPQA: A Graduate-Level Google-Proof Q&A Benchmark, 2023. https://arxiv.org/abs/2311.12022.
- Team, A. The Claude 3 Model Family: Opus, Sonnet, Haiku. Available online: (accessed on 3 November 2025).
- Naman Jain, I. S., King Han, Alex Gu, Wen-Ding Li, Fanjia Yan, Tianjun Zhang, Sida Wang, Armando Solar-Lezama, Koushik Sen. LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code. ArXiv Prepr. 2024.
- Li, T.; Chiang, W.-L.; Frick, E.; Dunlap, L.; Wu, T.; Zhu, B.; Gonzalez, J. E.; Stoica, I. From Crowdsourced Data to High-Quality Benchmarks: Arena-Hard and BenchBuilder Pipeline, 2024. https://arxiv.org/abs/2406.11939.
- Patil, S. G.; Mao, H.; Cheng-Jie Ji, C.; Yan, F.; Suresh, V.; Stoica, I.; E. Gonzalez, J. The Berkeley Function Calling Leaderboard (BFCL): From Tool Use to Agentic Evaluation of Large Language Models. In Forty-second International Conference on Machine Learning; 2025.
- Banerjee, S.; Agarwal, A.; Singla, S. LLMs Will Always Hallucinate, and We Need to Live With This, 2024. https://arxiv.org/abs/2409.05746.
- Paech, S. J. EQ-Bench: An Emotional Intelligence Benchmark for Large Language Models, 2024. https://arxiv.org/abs/2312.06281.
- Wu, Y.; Mei, J.; Yan, M.; Li, C.; Lai, S.; Ren, Y.; Wang, Z.; Zhang, J.; Wu, M.; Jin, Q.; Huang, F. WritingBench: A Comprehensive Benchmark for Generative Writing, 2025. https://arxiv.org/abs/2503.05244.
- Pyatkin, V.; Malik, S.; Graf, V.; Ivison, H.; Huang, S.; Dasigi, P.; Lambert, N.; Hajishirzi, H. Generalizing Verifiable Instruction Following, 2025. https://arxiv.org/abs/2507.02833.








| Symbol | Name | Unit |
|---|---|---|
| Temperature on the inner surface of the cold face. | K | |
| Temperature on the outer surface of the hot face. | K | |
| Temperature on the outer surface of the cold face. | K | |
| Temperature on the inner surface of the hot face. | K | |
| Cold source temperature. | K | |
| Hot zone temperature. | K | |
| Peltier heat flow sink at node . | W | |
| Peltier heat flow source at node . | W | |
| . Joule heat flow. | W | |
| . Heat flow by conduction between and . | W | |
| Seebeck coefficient. | V/K | |
| Internal electrical resistance of the module. | ||
| Thermal resistance by conduction. | K/W | |
| Thermal resistance of the ceramic on the hot face. | K/W | |
| Thermal resistance of the ceramic on the cold face. | K/W | |
| Thermal resistance of the heat sink on the hot face. | K/W | |
| Thermal resistance of the heat sink on the cold face. | K/W | |
| Thermal capacitance of node of the inner hot face. | J/K | |
| Thermal capacitance of node of the inner cold face. | J/K | |
| Thermal capacitance of the ceramic on the hot face. | J/K | |
| Thermal capacitance of the ceramic on the cold face. | J/K | |
| Resistance of the external electrical load. | ||
| Electric current generated that circulates through the circuit. | A | |
| Voltage generated at the load terminals . | V | |
| . Seebeck voltage. | V |
| Classification | Quantity | (%) | Main objective and justification |
|---|---|---|---|
| Pure domain | 93 | 46.0 | To inject factual knowledge, theoretical knowledge and terminology from the field of thermoelectricity. |
| Calculation | 5 | 2.5 | To teach the model to apply domain-specific mathematical formulas to solve practical problems. |
| Skill-based | 96 | 47.5 | To teach a behavior. How to structure complex responses consistently to a variety of instructions, especially equations. |
| General Purpose | 8 | 4.0 | To mitigate catastrophic forgetting, maintain the overall versatility of the model, and ensure that it does not become over-specialized. |
| 202 | 100.0 |
| Question | Main Topic | Level | Evaluation |
|---|---|---|---|
| 1 | Equation of the node on the outside of the hot face, | 1 | excellent |
| 2 | Equation of the node inside the cold face, | 1 | excellent |
| 3 | Equation of the inner surface node of the internal hot face with Peltier and Joule effects, | 2 | excellent |
| 4 | Equations of the two internal junctions | 2 | excellent |
| 5 | Equations at the 4 nodes , | 2 | correct with difficulties |
| 6 | Cold side equations of the system | 2 | excellent |
| 7 | Open electrical circuit scenario =0 | 2 | excellent |
| 8 | Interpretation of the term storage | 1 | excellent |
| 9 | State variable format: solving the derivate | 1 | excellent |
| 10 | Combined conceptual balance of internal nodes | 3 | excellent |
| 11 | Steady-state equation at a node | 1 | excellent |
| 12 | TEG leg geometry: trade-off | 3 | correct with difficulties |
| 13 | Material selection and merit figure ZT | 4 | excellent |
| 14 | Geometry and contact strength | 4 | excellent |
| 15 | Temperature-dependent properties | 4 | excellent |
| 16 | Interpretation of simulation results | 4 | excellent |
| Algorithm |
Time (s) |
Final error |
(V/K) |
() |
(K/W) |
(K/W) |
(K/W) |
(K/W) |
| GA | 1128.76 | 0.00291 | 0.0171 | 2.4457 | 20.8545 | 0.0759 | 0.2379 | 0.0890 |
| GAN | 1235.58 | 0.00276 | 0.0151 | 2.0669 | 23.0098 | 0.0833 | 0.0941 | 0.0988 |
| DE | 108.90 | 0.00288 | 0.0155 | 1.9940 | 24.0509 | 0.0875 | 0.4778 | 0.1035 |
| SHGO | 6.67 | 0.56488 | 0.3496 | 5.0000 | 15.0500 | 0.0111 | 1.0000 | 0.0133 |
| (°C) | Data source | (°C) | (°C) |
|---|---|---|---|
| Experimental | 1.079 | 19.076 | |
| GA | 1.078 | 19.092 | |
| 0.0 | GAN | 1.079 | 19.075 |
| DE | 1.078 | 19.080 | |
| SHGO | 1.081 | 19.088 | |
| Experimental | 86.030 | 23.288 | |
| GA | 85.994 | 23.279 | |
| 90.0 | GAN | 86.038 | 23.317 |
| DE | 86.033 | 23.291 | |
| SHGO | 86.170 | 23.216 |
| Benchmark | Qwen3-4B- Thinking-2507 | Qwen3-4B- Thinking | Qwen3-4B- Instruct-2507 | Qwen3-4B- Non-Thinking |
|---|---|---|---|---|
| GPQA [43] | 65.8 | 55.9 | 62.0 | 41.7 |
| AIME25 [44] | 81.3 | 65.6 | 47.4 | 19.1 |
| LiveCodeBench v6 [45] |
55.2 | 48.4 | 35.1 | 26.4 |
| Arena-Hard v2 [46] | 34.9 | 13.7 | 43.4 | 9.5 |
| BFCL-v3 [47] | 71.2 | 65.9 | 61.9 | 57.6 |
| Model | Success | Errors |
Hit rate (%) |
Average time (s/answer) |
| Base model without FT | ||||
| Llama3-8B | 2 | 40 | 4.80 | 22 |
| Mistral-7B | 3 | 39 | 7.10 | 24 |
| JanV1-4B | 13 | 29 | 30.95 | 260 |
| Qwen3-4B-Thinking-2507 | 32 | 10 | 76.20 | 300 |
| Models with FT | ||||
| JanV1-4B-expert-TEG | 34 | 8 | 81.00 | 231 |
| Qwen3-4B-Thinking-2507-TEG | 34 | 7 | 82.90 | 486 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).