Introduction
In traditional machine learning, tabular data and text data are treated as distinct modalities. Tabular data, characterized by rows and columns of numerical and categorical values, is typically processed using tree-based models like XGBoost or Random Forests. Conversely, text data is the domain of sequence models such as LSTMs and Transformers. When datasets contain both types, the standard practice is to "tabularize" the text through embeddings or TF-IDF, often losing the inherent relational structure between features.
This paper proposes a paradigm shift: converting tabular data into text strings and processing them with Natural Language Processing (NLP) techniques. The proposed Text-Based Classification (TBC) framework utilizes a vanilla character-level LSTM to achieve performance comparable to state-of-the-art tabular models while excelling at complex relational tasks that traditional models struggle to solve without manual feature engineering.
Methodology
The TBC framework consists of two primary stages: serialization and learning.
Serialization (Pre-processing)
Every row in a table is converted into a single string. Categorical and string attributes are preserved as-is. Numerical attributes are converted into their textual representation digit-by-digit (e.g., 1.124 becomes "one point one two four"). The resulting string is formatted with specific delimiters: an asterisk (*) at the start, tabs (\t) between attributes, and a tilde (~) at the end.
Learning Architecture
The serialized string is fed into a character-level Long Short-Term Memory (LSTM) network. Each character is represented as a one-hot encoded vector based on the ASCII-128 character set. The LSTM processes the sequence, and the final hidden state serves as an embedding that is passed to a task-based classification layer.
Crucially, this setup uses a "vanilla" LSTM without complex hyperparameter tuning or specialized architectures to demonstrate the inherent power of the representation change.
Experimental Setup
The authors evaluated TBC on both synthetic and real-world datasets:
- Synthetic Relational Tasks: String Equivalence (checking if two features are identical), Substring Matching (checking if one feature is contained within another), and Number Properties (identifying odd numbers).
- Public Benchmarks: Standard datasets including Adult (income prediction), Titanic (survival prediction), Iris (flower classification), and Dress (sales attributes).
Results and Discussion
The core insight of this work is that treating a row as a sentence allows the model to learn patterns across features more naturally.
Relational Logic and Generalization
TBC demonstrated significant superiority in relational tasks. For instance, in the "Number Properties" task, TBC achieved 1.00 accuracy on unseen test data by learning the pattern of characters associated with odd numbers. In contrast, standard Decision Trees struggled with a test accuracy of 0.38, as they often fail to generalize to unseen numbers by treating them as unique numerical values or categories.
In the String Equivalence and Substring Matching tasks, TBC significantly outperformed baselines on test sets. While baselines could "memorize" training data (100% training accuracy), their test performance often dropped below 60%. TBC maintained much higher stability and generalization.
Benchmark Performance
On real-world datasets like Adult and Titanic, TBC's accuracy (84% and 78% respectively) was within a few percentage points of optimized XGBoost and Random Forest models, despite TBC requiring minimal hyperparameter tuning. However, TBC struggled on the purely numeric Iris dataset (55% accuracy vs 96% for baselines). This highlights a current weakness: character-based LSTMs struggle with precise mathematical inequalities compared to tree-based split points.
Conclusion
The TBC framework offers a promising unified approach to tabular data, reducing the need for heavy preprocessing and manual feature engineering for relational logic. While currently limited by higher computational costs—taking 158 seconds to train on String Equivalence compared to 1.59 seconds for a Decision Tree—future work incorporating word embeddings (e.g., BERT) could capture deeper semantic meanings and further bridge the performance gap.
Summary updated