What kind of data lake do we need in the Big Model era?

<p>

In the context of the era of large models, big data and AI are undoubtedly the two most important technical ecosystems. However, the technical ecosystems of big data and AI exhibit significant division in many aspects. This division is particularly prominent in terms of storage, format, process, framework, and platform, which often poses significant challenges for developers when implementing end-to-end data processing and AI workflows.
Therefore, as an open-source data lakehouse project called LakeSoul, we are committed to seeking new solutions to more effectively integrate big data and AI, bridging the gap between them. We have adopted an integrated approach of Data + AI to enable users to seamlessly connect data processing with AI model applications, facilitating bidirectional interaction between data lakes and large-scale AI models.</p>
<p>1.Perfect combination</p>
<p>1.1	Data+AI integration design</p>
<p>LakeSoul technology architecture successfully achieves the perfect combination of Java big data ecosystem and Python AI ecosystem, enabling support for training and reasoning in various AI frameworks. Additionally, the LakeSoul framework provides a comprehensive suite of solutions with broad applicability due to its powerful data management and computing capabilities. It supports big data computing engines such as Spark, Flink, Presto, etc., catering to common needs in stream processing, batch computing, and BI analysis. Furthermore, LakeSoul seamlessly integrates with AI and data science computing frameworks like PyTorch, Pandas, HuggingFace, Ray.</p>
<p>1.2	Provide a solid data foundation for AI models</p>
<p>The LakeSoul architecture, with its efficient and stable data processing capabilities, can easily handle terabytes of large-scale data, whether structured or unstructured. This ability is crucial to the training and reasoning of large models, because to improve the reasoning effect of large models, it is necessary to support a large number of training data. In addition, LakeSoul architecture's high-performance Native IO design can ensure the efficiency of large model training, further enhancing its competitiveness in the field of AI.
In the early stage of large-scale model training, it is usually necessary to carry out strict data screening and cleaning. This process involves a lot of ETL work, and needs to rely on big data systems such as Spark for data pre-processing, including new data writing, data de-duplication, dirty data cleaning, etc., and requires multiple rounds of model training iterations for different data versions. LakeSoul's all-in-one design, with its partitioning, snapshot, and incremental read and write capabilities, accelerates the pace of model iteration.</p>
<p>1.3	The potential to unlock multimodal data easily</p>
<p>LakeSoul architecture has the ability to process unstructured data, including multimodal data such as text, image, audio and video, and these rich data resources can be used to train multimodal AI large models such as Bert, CLIP, GPT, Stable Difusion, etc. This feature of the LakeSoul architecture increases the potential for multimodal data release.</p>
<p>2.Application cases</p>
<p>The AI modeling process based on LakeSoul is shown in the figure below. LakeSoul has the ability to process both stream and batch data at the same time, and supports sample pre-processing on a data lake. With Native IO, LakeSoul can directly connect AI models. In the following part, we will introduce in detail how to improve the whole process of model training, reasoning and application by relying on lakesoul Lake storage platform and seamless integration of AI ecology such as Pytorch/HuggingFace. We've posted the full code on GitHub, which you can access at the following link:
<a href="https://github.com/lakesoul-io/LakeSoul/python/examples" rel="nofollow">https://github.com/lakesoul-io/LakeSoul/python/examples</a></p>
<p>2.1 Start with a binary classification problem</p>
<p>Here we start with the classic case of Kaggle Titanic. In this case, we conducted modeling based on LakeSoul+PyTorch. Binary classification problem is widely used in the industry, such as the ranking of advertising and recommendation system, loan overdue estimation and other problems can be modeled into binary classification problem theoretically. Here, our main work is divided into three stages to illustrate:
1.At the stage of data entering the lake, the original data is imported into LakeSoul:
<a href="https://cdn-uploads.huggingface.co/production/uploads/6501873983de015e088440ee/4vtDoJb6FiizRSQQCvpsV.png" rel="nofollow"><img alt="image/png" src="https://cdn-uploads.huggingface.co/production/uploads/6501873983de015e088440ee/4vtDoJb6FiizRSQQCvpsV.png"/></a>
2.In the data processing stage, we carried out feature engineering on the LakeSoul platform, including One-Hot coding, feature derivation, normalization and other operations for category features:</p>
<p><a href="https://cdn-uploads.huggingface.co/production/uploads/6501873983de015e088440ee/JXjo0hVfBlQNx_CFUIi8k.png" rel="nofollow"><img alt="image/png" src="https://cdn-uploads.huggingface.co/production/uploads/6501873983de015e088440ee/JXjo0hVfBlQNx_CFUIi8k.png"/></a></p>
<p>3.In the model training stage, we introduced the 3-layer neural network model written by PyTorch for training and verification:</p>
<p><a href="https://cdn-uploads.huggingface.co/production/uploads/6501873983de015e088440ee/bxcJYI4bLHdF1rQqTOnYe.png" rel="nofollow"><img alt="image/png" src="https://cdn-uploads.huggingface.co/production/uploads/6501873983de015e088440ee/bxcJYI4bLHdF1rQqTOnYe.png"/></a></p>
<p>Although we are dealing with static data sets in this case, LakeSoul's design philosophy and technical architecture can support real-time updating of data, real-time updating of features, and online learning of models. This case demonstrates LakeSoul's ability to handle large-scale data set computation, feature engineering, and support AI model training and validation.</p>
<p>2.2 NLP pre-training model fine-tuning</p>
<p>The previous example of Titanic has explained the process of "data entering the lake -&gt; preprocessing -&gt; model training". Below, a model with emotional tendency is trained by IMDB data set. Shows how to fine-tune the Trainer API based on the Bert model (distilbert-base-uncased) through HuggingFace.
Compare the IMDB example provided by the original HuggingFace: <a href="https://huggingface.co/docs/transformers/tasks/sequence_classification">https://huggingface.co/docs/transformers/tasks/sequence_classification</a>
We just need to get the data source stored on LakeSoul through the Iteratable Dataset in the code and make some adjustments on the TrainingArguments, but most of the rest of the code remains basically unchanged:</p>
<p><a href="https://cdn-uploads.huggingface.co/production/uploads/6501873983de015e088440ee/lJs1Q7fOOMZJ9babeUHPk.png" rel="nofollow"><img alt="image/png" src="https://cdn-uploads.huggingface.co/production/uploads/6501873983de015e088440ee/lJs1Q7fOOMZJ9babeUHPk.png"/></a></p>
<p>2.3CLIP based text and text search</p>
<p>The previous IMDB example has shown how to train a model using the LakeSoul and HuggingFace Trainer apis. In this case, we will use the Food 101 data set to show how to use CLIP model to reason samples and realize the function of picture and text search. The processing process mainly includes two stages:
1.	Model reasoning: CLIP model on HuggingFace (Clip-VIT-B-32-Multilingual v1) is introduced, where clip model is used to reason on images in the image data set and the Embedding of each image is generated:</p>
<p><a href="https://cdn-uploads.huggingface.co/production/uploads/6501873983de015e088440ee/6Jj64YYdOmhh78e-_j0gd.png" rel="nofollow"><img alt="image/png" src="https://cdn-uploads.huggingface.co/production/uploads/6501873983de015e088440ee/6Jj64YYdOmhh78e-_j0gd.png"/></a></p>
<p>2.Semantic search: Specifically, the user can enter a text description, and the system returns the most matched image by calculating the vector distance between the text and the image:</p>
<p><a href="https://cdn-uploads.huggingface.co/production/uploads/6501873983de015e088440ee/ekHfZJEQxvNDPUHHz2vE3.png" rel="nofollow"><img alt="image/png" src="https://cdn-uploads.huggingface.co/production/uploads/6501873983de015e088440ee/ekHfZJEQxvNDPUHHz2vE3.png"/></a></p>
<p>Conlusion</p>
<p>In the last article, we explored LakeSoul's Data+AI design concept in depth, and in this article we give a few concrete practice cases. In the future, we plan to publish more articles detailing how LakeSoul integrates with leading open source AI frameworks like PyTorch, HuggingFace, DeepSpeed, Ray, and more.
Just as Jobs redefined the mobile phone and the iPhone opened up a whole new world of mobile Internet for users, LakeSoul is redefining the data lake in the era of big models and has successfully integrated the Java big Data ecosystem and the Python AI ecosystem perfectly. With LakeSoul, developers can quickly implement applications from data processing to AI models, easily unlocking the value of multimodal data. We firmly believe that this will open a new chapter for data lake technology in the era of large models!</p>
