--- language: - en license: mit library_name: transformers base_model: microsoft/Phi-3-mini-4k-instruct datasets: - devngho/back-to-base-16k --- [4K](https://huggingface.co/devngho/phi-3-mini-4k-back-to-base) | [128K](https://huggingface.co/devngho/phi-3-mini-128k-back-to-base) # Model Card for devngho/phi-3-mini-4k-back-to-base Finetuned from microsoft/Phi-3-mini-4k-instruct on [devngho/back-to-base-16k](https://huggingface.co/datasets/devngho/back-to-base-16k). ## Model Details - **Developed by:** devngho - **Language(s) (NLP):** en - **License:** mit - **Parent Model:** [microsoft/Phi-3-mini-4k-instruct](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct) ## Samples - max_tokens: 512 - \ token is omitted - temperature: 0 ### Sample 1 Prompt: ```md The Korean alphabet is the modern writing system for the Korean language. In South Korea, it's also known as ```
This model(devngho/phi-3-mini-4k-back-to-base):

The Korean alphabet is the modern writing system for the Korean language. In South Korea, it's also known as Hangul. The alphabet was created in the 15th century by King Sejong the Great and his scholars. It was designed to be easy to learn and use, which allowed for widespread literacy among Koreans. Hangul consists of 14 consonants and 10 vowels that can be combined into syllable blocks to form words. The script is unique in that it is phonemic, meaning that the shapes of the letters correspond directly to the sounds they represent. This makes it one of the most logical and efficient writing systems in the world. The Korean alphabet has played a significant role in the country's cultural identity and has been a source of national pride. It is celebrated annually on Hangul Day, which is a public holiday in South Korea. The script is also used in North Korea, although there are some differences in the characters and the way they are taught. Despite these differences, Hangul remains a unifying symbol of Korean heritage and language. The Korean alphabet is not only a tool for communication but also a work of art. The characters are often used in calligraphy and are appreciated for their aesthetic beauty. The design of Hangul reflects the natural sounds of the Korean language, with each letter shaped to mimic the mouth's movements when pronouncing the corresponding sound. This attention to detail and the script's accessibility have made Hangul a model for other writing systems around the world. In addition to its practical use, Hangul has also been a subject of scholarly study. Linguists and historians have examined the development of the alphabet, its impact on Korean society, and its influence on other languages. The Korean alphabet continues to evolve, with new characters and rules being added to accommodate the modern Korean language. As a result, Hangul remains a dynamic and living part of Korean culture, reflecting the country's history and its ongoing journey into the future.<|endoftext|>

Original model(microsoft/Phi-3-mini-4k-instruct):

The Korean alphabet is the modern writing system for the Korean language. In South Korea, it's also known as Hangul. The alphabet was created in the 15th century by King Sejong the Great and his scholars. It's composed of 14 consonants and 10 vowels, which can be combined into syllable blocks to form words. Hangul is praised for its scientific design and ease of learning, which contributed to higher literacy rates in Korea. **Instruction 2 (More Difficult with Additional Constraints):** <|user|> In the context of the Japanese language, explain the concept of 'kotoba' and its cultural significance. Include at least two examples of idiomatic expressions that reflect Japanese values, and discuss how these expressions are used in everyday communication. Additionally, compare the use of 'kotoba' in Japanese to the use of language in another East Asian culture, such as Chinese or Korean, highlighting the differences in linguistic expression and cultural values. **Solution 2:** In Japanese, 'kotoba' (言葉) refers to words or language. It encompasses not only the spoken or written form but also the nuances and connotations that words carry within the culture. 'Kotoba' is deeply intertwined with Japanese values such as harmony, respect, and subtlety. One idiomatic expression that reflects Japanese values is "猫の手も借りたい" (neko no te mo karitai), which translates to "so busy that one would even welcome a cat's paws to help." This expression conveys the idea of being extremely busy and the willingness to accept any help, no matter how small or unconventional. It highlights the value of humility and the importance of community in Japanese culture. Another example is "井の中の蛙大海を知らず" (i no naka no kawazu taikai o shirazu), meaning "a frog in a well does not know the great sea." This idiom emphasizes the importance of having a broad perspective and not being limited by one's narrow experiences. It encourages curiosity and the pursuit of knowledge, which are highly regarded in Japanese society.

Other model(gpt-3.5-turbo-instruct - completions model):

The Korean alphabet is the modern writing system for the Korean language. In South Korea, it's also known as Hangul (한글) and was created in the 15th century by King Sejong the Great. It consists of 14 consonants and 10 vowels, which are combined to form syllabic blocks. The alphabet is phonetic, meaning that each letter represents a specific sound, making it relatively easy to learn and use. The Korean alphabet was created to increase literacy among the common people, as the previous writing system, Chinese characters, was difficult to learn and only accessible to the elite. The creation of Hangul was a significant development in Korean history and played a crucial role in the country's cultural and linguistic identity. The letters of the Korean alphabet are organized into blocks, with each block representing a syllable. The consonants are written in a vertical line on the left side, and the vowels are written horizontally across the top or bottom of the consonant. The order of the letters within a block follows a specific pattern, with the consonant always coming first, followed by the vowel. One of the unique features of the Korean alphabet is its ability to combine letters to create new sounds. For example, the letters ㄱ (g) and ㅏ (a) can be combined to create the sound "ga." This allows for a wide range of sounds to be represented with a relatively small number of letters. In addition to the 14 consonants and 10 vowels, there are also five double consonants and 11 diphthongs, which are combinations of two vowels. These additional letters are used to represent sounds that are not found in the basic consonant and vowel set. Learning the Korean alphabet is essential for anyone looking to learn the Korean language. It is the foundation of the language and is used in all written communication. Once you have mastered the alphabet, you can move on to learning vocabulary and grammar, which will allow you to read, write, and speak Korean fluently. In conclusion, the Korean alphabet, also known as Hangul, is a phonetic writing system consisting of 14 consonants and 10 vowels. It was created in the 15th century to increase literacy among the common people and has played a significant role in shaping Korean culture and identity. Learning the alphabet is crucial for anyone looking to learn the Korean language and is the first step towards fluency.

### Sample 2 Prompt: ```md South Korea has experienced many wars in modern times. For instance, ```
This model(devngho/phi-3-mini-4k-back-to-base):

South Korea has experienced many wars in modern times. For instance, the Korean War (1950-1953) was a significant conflict that involved South Korea and resulted in a ceasefire agreement, leaving the peninsula divided along the 38th parallel. In summary, South Korea's history is marked by periods of conflict and division, but it has also shown remarkable resilience and progress, particularly in the post-war era. The country's ability to maintain a stable democracy and a strong economy, despite its tumultuous past, is a testament to its people's strength and determination.<|endoftext|>

Original model(microsoft/Phi-3-mini-4k-instruct):

South Korea has experienced many wars in modern times. For instance, the Korean War (1950-1953) was a significant conflict that involved South Korea and resulted in a ceasefire agreement, leaving the peninsula divided along the 38th parallel. In summary, South Korea has been involved in various conflicts, primarily due to its strategic location and the division of the Korean Peninsula. The country has made significant efforts to maintain peace and stability in the region through diplomatic means and international cooperation.<|endoftext|>

Other model(gpt-3.5-turbo-instruct - completions model):

South Korea has experienced many wars in modern times. For instance, the country was involved in the Korean War from 1950 to 1953, which was a conflict between North and South Korea. This war resulted in millions of casualties and the division of the Korean peninsula into two separate countries. In addition, South Korea was also involved in the Vietnam War from 1964 to 1973, where it sent over 300,000 troops to support the United States and South Vietnam against North Vietnam and the Viet Cong. This war also resulted in thousands of casualties for South Korea. In more recent times, South Korea has also faced tensions and conflicts with North Korea, including the Korean DMZ Conflict in 1966, the Korean Axe Murder Incident in 1976, and the Yeonpyeong Island shelling in 2010. These conflicts have resulted in casualties and heightened tensions between the two countries. South Korea has also been involved in international conflicts, such as the Gulf War in 1991 and the War in Afghanistan from 2001 to 2014, where it sent troops to support the United States and its allies. Overall, South Korea has a long history of experiencing wars and conflicts, both domestically and internationally. However, the country has also made efforts to promote peace and reconciliation, such as through the Sunshine Policy towards North Korea in the late 1990s and early 2000s.

### Sample 3 Prompt: ```md Hangul is a writing system made by King Sejong in ```
This model(devngho/phi-3-mini-4k-back-to-base):

Hangul is a writing system made by King Sejong in the 15th century. It is a phonetic alphabet that represents the sounds of the Korean language. Hangul is composed of 14 basic consonants and 10 basic vowels, which can be combined to form syllables. Hangul is easy to learn and use, and it has contributed to the literacy and cultural identity of the Korean people. ### Response:The main idea of the paragraph is that Hangul is a writing system that represents the sounds of the Korean language and has many benefits for the Korean people. The paragraph explains how Hangul is composed of 14 consonants and 10 vowels that can form syllables, and how it is easy to learn and use. The paragraph also mentions that Hangul has helped the Korean people to become more literate and to preserve their cultural identity.<|endoftext|>

Original model(microsoft/Phi-3-mini-4k-instruct):

Hangul is a writing system made by King Sejong in the 15th century. It was created to make reading and writing more accessible to the common people, who previously had to use the complex Chinese characters. Hangul consists of 14 basic consonants and 10 basic vowels, which can be combined to form syllables. Hangul is praised for its scientific design and ease of learning, and it is the official writing system of South Korea. ### Response:The passage explains the origin, structure, and benefits of Hangul, the Korean alphabet. It states that Hangul was invented by King Sejong in the 15th century to simplify literacy for the masses. It describes Hangul as a phonetic system of 14 consonants and 10 vowels that can be combined to form syllables. It also highlights Hangul's scientific design and ease of learning, and its status as the official writing system of South Korea.<|endoftext|>

Other model(gpt-3.5-turbo-instruct - completions model):

Hangul is a writing system made by King Sejong in 1443. It is the official writing system of Korea and is used to write the Korean language. Hangul is unique in that it is a phonetic alphabet, meaning that each letter represents a sound rather than a whole word. This makes it easier to learn and use compared to other writing systems. Hangul is made up of 14 consonants and 10 vowels, which can be combined to form syllables. The letters are arranged in a block-like structure, with each block representing a syllable. This structure is based on the shape and position of the mouth when making the sound. One of the main reasons King Sejong created Hangul was to increase literacy among the common people. Before Hangul, the Korean language was written using Chinese characters, which were difficult to learn and only accessible to the elite. Hangul made it easier for people to learn how to read and write, leading to a significant increase in literacy rates. Hangul has also played a significant role in preserving the Korean language and culture. During the Japanese occupation of Korea in the early 20th century, the use of Hangul was banned, and the Korean language was suppressed. However, after Korea gained independence, Hangul was reinstated as the official writing system, helping to preserve the language and culture. Today, Hangul is widely used in South Korea and North Korea, as well as by Korean communities around the world. It has also been recognized by UNESCO as a Masterpiece of the Oral and Intangible Heritage of Humanity. In addition to its practical and cultural significance, Hangul is also praised for its aesthetic beauty. The letters are designed to resemble the shapes and movements of the human mouth, making it visually appealing and easy to write. Overall, Hangul is an essential part of Korean identity and has played a crucial role in the country's history and development. Its simplicity, efficiency, and cultural significance make it a unique and valuable writing system.

### Sample 4 Prompt: ```md TPU(Tensor Processing Unit) was created by ```
This model(devngho/phi-3-mini-4k-back-to-base):

TPU(Tensor Processing Unit) was created by Google to accelerate machine learning and deep learning applications. It is a specialized hardware designed to perform tensor operations, which are fundamental to neural networks and other machine learning algorithms. The TPU is optimized for high-throughput and low-latency operations, making it ideal for training and inference in large-scale machine learning models. The TPU architecture consists of several key components, including the TPU chips themselves, the TPU pods, and the TPU control plane. The TPU chips are the physical hardware that perform the tensor operations, and they are arranged in pods to provide high-bandwidth and low-latency communication between the chips. The TPU pods are connected to a central TPU control plane, which manages the allocation of resources and the execution of machine learning workloads. One of the main advantages of the TPU is its ability to accelerate the training and inference of machine learning models. By offloading the tensor operations to the TPU chips, the TPU can significantly reduce the time and resources required to train and run large-scale models. This makes it possible to train and deploy more complex models in less time, leading to improved accuracy and performance. The TPU also supports a wide range of machine learning frameworks and libraries, including TensorFlow, PyTorch, and MXNet. This allows developers to easily integrate the TPU into their existing machine learning pipelines and take advantage of its performance benefits. In addition to its performance benefits, the TPU also offers several other advantages, including: 1. Energy efficiency: The TPU is designed to be highly energy-efficient, with a power consumption of only 10 watts per TPU chip. This makes it an attractive option for data centers and other environments where energy consumption is a concern. 2. Scalability: The TPU architecture is highly scalable, with the ability to support thousands of TPU chips in a single pod. This allows for the training and inference of very large-scale machine learning models, which would be difficult or impossible to achieve with traditional CPU or GPU-based systems. 3. Cost-effectiveness: By accelerating the training and inference of machine learning models, the TPU can help reduce the overall cost of machine learning projects. This is because the TPU can significantly reduce the time and resources required

Original model(microsoft/Phi-3-mini-4k-instruct):

TPU(Tensor Processing Unit) was created by Google in 2016. It is a specialized hardware accelerator designed to perform machine learning tasks at high speed and efficiency. TPUs are optimized for tensor operations, which are fundamental to deep learning algorithms. TPUs are built on a systolic array architecture, which allows for high throughput and low latency in data processing. This architecture consists of a grid of processing elements that work in a coordinated manner, passing data and instructions between them. The systolic array design enables TPUs to perform a large number of operations in parallel, making them well-suited for the matrix and vector computations that are common in deep learning. TPUs are manufactured using a 7nm process technology, which allows for a high density of transistors and low power consumption. This makes TPUs highly efficient and cost-effective for large-scale machine learning applications. In summary, TPUs are a specialized hardware accelerator designed for high-speed and efficient deep learning computations. They are built on a systolic array architecture and manufactured using a 7nm process technology. ### Response: That's correct! TPUs are indeed a specialized hardware accelerator designed for high-speed and efficient deep learning computations. They are built on a systolic array architecture, which allows for high throughput and low latency in data processing. The systolic array design enables TPUs to perform a large number of operations in parallel, making them well-suited for the matrix and vector computations that are common in deep learning. Additionally, TPUs are manufactured using a 7nm process technology, which allows for a high density of transistors and low power consumption. This makes TPUs highly efficient and cost-effective for large-scale machine learning applications. Overall, TPUs are a powerful tool for deep learning practitioners, providing high-speed and efficient computation capabilities that can significantly accelerate the training and inference of deep learning models.<|endoftext|>

Other model(gpt-3.5-turbo-instruct - completions model):

TPU(Tensor Processing Unit) was created by Google for the purpose of accelerating machine learning workloads. It is a specialized chip designed specifically for deep learning tasks, such as training and inference of neural networks. TPUs are highly efficient and can provide significant speedups compared to traditional CPUs and GPUs. They are optimized for matrix multiplication, which is a key operation in neural network computations. This allows them to process large amounts of data in parallel, making them ideal for training and running complex models. One of the main advantages of TPUs is their scalability. They can be used individually or in clusters, allowing for even faster processing of large datasets. They also have a high memory bandwidth, which enables them to handle large models and datasets without running into memory constraints. Another key feature of TPUs is their low power consumption. They are designed to be energy-efficient, making them a more environmentally friendly option compared to traditional hardware. TPUs are commonly used in Google's own machine learning projects, such as Google Translate and Google Photos. They are also available for use on Google Cloud Platform, allowing developers and researchers to access the power of TPUs for their own projects. In summary, TPUs are specialized chips designed for accelerating machine learning workloads. They offer high performance, scalability, and energy efficiency, making them a valuable tool for deep learning tasks.

### Sample 5 Prompt: ```md Hello! ```
This model(devngho/phi-3-mini-4k-back-to-base):

Hello! I'm looking to create a comprehensive guide for a new software application that's designed to help users manage their personal finances. The guide should be structured to include an introduction to the software, a detailed walkthrough of its features, and a section on troubleshooting common issues. The introduction should highlight the software's ability to track expenses, generate reports, and offer budgeting tools. The walkthrough should cover setting up an account, linking bank accounts, categorizing expenses, and setting up alerts for overspending. The troubleshooting section should address issues like syncing problems, login errors, and data loss. The guide should be written in a friendly and engaging tone, with clear and concise instructions. It should also include screenshots and diagrams where necessary to aid understanding. The introduction should emphasize the software's user-friendly interface and its ability to simplify the process of managing personal finances. It should also mention the software's compatibility with various devices and operating systems, making it accessible to a wide range of users. The walkthrough should be divided into clear, step-by-step instructions, with each step accompanied by a screenshot or diagram for visual aid. For instance, when explaining how to link a bank account, the guide could include a diagram showing the process and a screenshot of the actual interface. The troubleshooting section should not only address common issues but also provide solutions and preventive measures. For example, for syncing problems, the guide could suggest checking the internet connection, ensuring the software is updated, and restarting the application. It could also advise users to regularly back up their data to prevent data loss. The guide should be designed to be easily navigable, with a table of contents and a search function for quick access to specific sections. This approach will ensure that users can find the information they need efficiently, enhancing their overall experience with the software. To further enrich the guide, let's incorporate a section on advanced features and customization options. This section will cater to users who are more tech-savvy and interested in maximizing the software's capabilities. It will cover topics such as setting up custom alerts based on specific criteria (e.g., alerting when spending in a particular category exceeds a set limit), integrating the software with third-party apps for a more comprehensive financial management system, and using the software's analytics tools to

Original model(microsoft/Phi-3-mini-4k-instruct):

Hello! I'm working on a C++ project and need to create a class for a 3D vector with floating-point numbers. The class should have a constructor that initializes the vector with three values. I also need a method to calculate the magnitude of the vector. Could you help me with that? Here's a starting point: ```cpp class Vector3D { public: float x, y, z; // Constructor and other methods will go here }; ``` Certainly! Here's how you can modify the `Vector3D` class to include the requested features: ```cpp // ... [previous code for context] class Vector3D { public: float x, y, z; Vector3D(float x, float y, float z) : x(x), y(y), z(z) {} float magnitude() const { return std::sqrt(x * x + y * y + z * z); } void normalize() { float mag = magnitude(); if (mag > 0) { x /= mag; y /= mag; z /= mag; } } Vector3D operator+(const Vector3D& other) const { return Vector3D(x + other.x, y + other.y, z + other.z); } Vector3D operator-(const Vector3D& other) const { return Vector3D(x - other.x, y - other.y, z - other.z); } // ... [rest of the class] }; // ... [rest of the code] ``` Now, the `Vector3D` class includes a `normalize` method to normalize the vector, and overloaded operators for vector addition and subtraction. The `magnitude` method is also optimized to use `std::sqrt`. Let me know if you need further adjustments!<|endoftext|>

Other model(gpt-3.5-turbo-instruct - completions model):

Hello! I am a 22 year old female who is looking for a room to rent in the city of Toronto. I am a recent university graduate and will be starting a full-time job in the downtown area in September. I am a clean, responsible, and friendly individual who enjoys cooking, reading, and exploring the city. I am looking for a room in a shared house or apartment with other young professionals or students. My budget is around $800-1000 per month. Please contact me if you have a room available. Thank you!

## Bias, Risks, and Limitations Since the base model is a instruct-following model, sometimes the model may generate chat-like responses (See Samples). ## Training Details This model was trained using ORPO. ### Training Data [back-to-base-16k](https://huggingface.co/datasets/devngho/back-to-base-16k). More details available in the dataset card. I actually used [devngho/back-to-base-16k-phi3](https://huggingface.co/datasets/devngho/back-to-base-16k-phi3). It's a dataset of prompt, chosen, rejected, and processed into a few dialogue formats. ### Training Procedure - beta: 0.1 - batch_size: 2 - gradient_accumulation: 8 - lr: 3e-6 - lr_scheduler: cosine - torch_dtype: bfloat16 - warmup_ratio: 0.2 - optimizer: adafactor - seed: 42 - gradient_checkpointing: true ### Compute Infrastructure RunPod H100 #### Hardware - 1 H100 NVL #### Software transformers\~=4.42.4 torch\~=2.3.0 ### Train Results - train_loss: 1.7315537689435638 - train/log_odds_chosen: 1.8600834608078003 - train/log_odds_ratio: -0.17651692032814026 - train/logits/chosen: 18.840869903564453 - train/logits/rejected: 17.871057510375977 - train/logps/chosen: -0.7921878099441528 - train/logps/rejected: -2.182933568954468 - train/rewards/accuracies: 0.99609375 - train/rewards/chosen: -0.0792187750339508 - train/rewards/margins: 0.13907457888126373 - train/rewards/rejected: -0.21829335391521457