arXiv Science⌕ Search

arXiv subjects

Gabriel Pimenta de Freitas Cardoso

Publications and source records attributed to Gabriel Pimenta de Freitas Cardoso.

2 recordsLinked to original sources

Predicting End-to-End Fine-Tuning Time for Generative Language Models

As organizations increasingly adopt the AI Factory paradigm, in which GPU-accelerated environments serve as production infrastructure for fine-tuning generative language models (GLMs), including large language models (LLMs) and small language models (SLMs), unpredictable training duration becomes an operational bottleneck. Under GPU scarcity and prohibitive compute costs, accurate estimation of end-to-end training time becomes critical for efficient resource utilization. However, estimating GLM fine-tuning duration is a multifactorial problem. Real-world pipelines also add orchestration overheads, such as model loading, periodic evaluation, and checkpointing, that affect wall-clock time. Existing analytical estimates fail to capture the end-to-end duration of full jobs running on a shared, multi-tenant production cluster. We present a machine learning-based methodology for predicting GLM fine-tuning job duration on GPU clusters, built on a feature set encompassing model, dataset, hardware, and fine-tuning configurations known before job dispatch, including engineered features that expose these overheads. Using production executions lasting 1.6 to 172.4 h (mean 23.43 h), we compare analytical baselines with linear and gradient-boosting regressors. The best analytical baseline reaches $R^2 = 0.31$ (MAE = 12.41 h), whereas the best predictor, based on CatBoost, achieved a mean absolute error (MAE) of 1.71 h, a median absolute error of 0.51 h, and a coefficient of determination ($R^2$) of 0.98 in 5-fold cross-validation.

cs.LG↗

DharmaOCR: Specialized Small Language Models for Structured OCR that outperform Open-Source and Commercial Baselines

This manuscript introduces DharmaOCR Full and Lite, a pair of specialized small language models (SSLMs) for structured OCR that jointly optimize transcription quality, generation stability, and inference cost. It also presents DharmaOCR-Benchmark, a benchmark that covers printed, handwritten, and legal/administrative documents, and proposes a unified evaluation protocol that measures fidelity and structure while explicitly tracking text degeneration as a first-class benchmark metric (alongside unit cost). Beyond reporting degeneration rates, the manuscript empirically shows degeneration is not merely a quality failure, since it materially worsens production performance by increasing response time, reducing throughput, and inflating computational cost due to abnormally long generations. To the best of the author's knowledge, as a methodological contribution, this is the first application of Direct Preference Optimization (DPO) for OCR, explicitly using degenerate generations as rejected examples to penalize looping behavior. Combined with Supervised Fine-Tuning (SFT) for enforcing a strict JSON schema (header, margin, footer, and text), DPO consistently reduces degeneration rate across model families (up to 87.6% relative) while preserving or improving extraction quality. The resulting models, namely, DharmaOCR Full (7B) and DharmaOCR Lite (3B), set a new state-of-the-art on DharmaOCR-Benchmark, outperforming each open-source and commercial baseline model evaluated regarding extraction quality, reaching 0.925 and 0.911 scores with 0.40% and 0.20% degeneration rates. AWQ quantization reduced up to 22% per-page cost with negligible quality loss, enabling a strong quality-cost trade-off in comparison to proprietary OCR APIs and open-source alternatives.

cs.CV↗