hiyouga / LLaMA-Factory

Efficiently Fine-Tune 100+ LLMs in WebUI (ACL 2024)
https://arxiv.org/abs/2403.13372
Apache License 2.0
31.84k stars 3.91k forks source link

Train with Nested rlhf datset format #3264

Closed JianbangZ closed 5 months ago

JianbangZ commented 5 months ago

Reminder

Reproduction

There is a great multiturn DPO/ORPO dataset https://huggingface.co/datasets/argilla/distilabel-capybara-dpo-7k-binarized Below is an sample. Basically the "question" column consists of a multiturn converstaion with {<|user|>\n ......<|assistant|>\n...<|user|>\n ......<|assistant|>\n}, and the "answer" is the typical "chosen" "reject" option for the last turn of existing conversation. How can LLama-Factory support this type of format? any guidence?

[ { "question": "<|user|>\nThe setting is an otherworldly, yet eerily familiar, metropolis known as \"Zephyria.\" It's a city suspended in the ether, floating amidst nebulous clouds of cosmic dust. The architecture here is surreal and alien, with buildings that twist and spiral like strands of DNA, reaching towards the cosmos. Streets are paved with luminescent cobblestones, casting soft hues of blues and purples, reflecting off iridescent structures. Strange vegetation, vibrant and bioluminescent, thrives everywhere, creating a stark contrast against the deep indigo sky.\n\nNow, immerse me in this ethereal journey through Zephyria.\n<|assistant|>\nAs you step onto the teleportation platform, there's a momentary sense of disorientation before your surroundings change abruptly. You find yourself standing on the outskirts of Zephyria, gazing at the sprawling metropolis that glows softly under the starlit canvas above. A gentle breeze, carrying hints of exotic fragrances from unknown flora, greets you. \n\nYou begin to walk along the radiant pathway, each cobblestone pulsating beneath your feet, resonating with a rhythm that seems almost alive. The cityscape ahead shimmers with countless shades of sapphire, amethyst, and turquoise, their reflections dancing upon the glassy surfaces of the spiraling towers around you. The air vibrates subtly with an underlying hum, a symphony of unseen energy sources powering this celestial city.\n\nApproaching one of the spiraling edifices, you reach out to touch its surface. It feels unexpectedly warm, humming slightly under your fingertips. Its translucent walls ripple with colors, revealing glimpses of life within - shadowy figures moving about, engaging in activities that seem both mundane and extraordinary.\n\nA creature, vaguely humanoid but adorned with shimmering scales and wings akin to a dragonfly\u2019s, approaches you. It communicates not with words, but with melodic sounds and changing color patterns across its body. Somehow, you understand it is offering guidance, inviting you to follow. \n\nThrough winding streets and soaring archways, you traverse Zephyria. Each turn reveals new wonders: a marketplace where vendors sell luminous fruits and crystalline artifacts; a park filled with trees bearing glowing leaves and blossoms, radiating light like tiny stars; a grand amphitheater where harmonious tones fill the air, created by entities playing instruments resembling nothing you've seen before.\n\nYour guide leads you to a towering structure at the city's heart, the pinnacle disappearing into the swirling mists above. As you ascend, the city unfolds below in all its radiant glory. From this vantage point, Zephyria looks like a constellation fallen from the heavens, its brilliance undimmed.\n\nReaching the summit, you're greeted by a panorama of the cosmos. Stars twinkle like diamonds strewn across black velvet, galaxies swirl in distant corners, and comets streak across the vast expanse. Here, atop Zephyria, you stand at the precipice of infinity, feeling simultaneously insignificant and integral to the universe's grand tapestry.\n\nFinally, your guide beckons you towards a portal, shimmering like liquid silver. Stepping through, you feel a rush of cool air as you emerge onto a balcony jutting out into the void. Below, the city sparkles, while above, the cosmos stretches out endlessly. In this moment, suspended between the celestial city and the infinite universe, you experience a profound connection, a unity with everything that was, is, and will be.\n\nAs the reality of your journey settles in, you realize that Zephyria isn't just a city in the stars; it's a testament to imagination, a monument to the boundless potential of sentient beings. And even as you prepare to leave, stepping back onto the teleportation platform, you know that the memory of this ethereal city, hanging in the balance between dream and reality, will stay with you forever.\n<|user|>\nDescribe the unique methods of communication used by the humanoid creature in Zephyria, elaborating on how the color patterns and melodic sounds can convey complex ideas and emotions.\n<|assistant|>\nThe Zephyrian humanoid communicates through a complex system that combines chromatics and sonics, a method that is as much an art form as it is a language. \n\nThe creature's body is covered in scales that can change color, similar to a chameleon, but far more advanced. These scales are capable of producing a wide spectrum of colors and patterns, each with its own unique meaning. Simple messages might be conveyed through a single hue, while more complex ideas are represented by intricate patterns that ripple across the creature's body. \n\nFor example, a pattern of spiraling blues and greens might indicate a philosophical discussion, with each shade and twist of the pattern adding nuances to the topic. Rapid shifts between warm and cool colors could represent a debate or disagreement, while a slow, rhythmic pulse of soft pastel colors might signify a casual, friendly conversation.\n\nThe melodic sounds the creature produces are equally important. These are not merely random notes, but carefully constructed melodies that carry meaning. Pitch, rhythm, and harmony all play a role in conveying information. A high, fast-paced melody might be used to express excitement or urgency, while a slow, low melody could indicate calm or sadness. \n\nMoreover, the creature can layer melodies to communicate complex emotions or ideas. For instance, a steady, rhythmic bass line might underlie a series of rapid, high-pitched notes, creating a melody that expresses the juxtaposition of stability and chaos.\n\nThe creature also uses silence effectively, creating pauses in its melodies to emphasize certain points or to allow its color patterns to convey more of the message. In this way, the creature's communication is a delicate balance of sound and color, each enhancing the other to create a rich, multifaceted language.\n\nWhile this form of communication may seem alien and complex, it has an inherent logic and beauty to it. Once understood, it offers a deep and nuanced way of expressing thoughts and emotions, making the interactions with these Zephyrian humanoids a truly unique experience.\n<|user|>\nHow does the Zephyrian humanoid perceive and interpret the color and sound patterns of its own species?\n", "answer": [ "The Zephyrian humanoid's perception and interpretation of color and sound patterns are deeply entwined with their biological makeup and neural processing. From a physiological standpoint, these creatures have evolved to perceive a broader spectrum of light and sound waves compared to humans. Their eyes can detect frequencies of light that humans cannot, resulting in their ability to see and interpret the vast array of colors they use for communication.\n\nTheir auditory system, on the other hand, is tuned to a wider range of frequencies, allowing them to perceive and produce melodies that we may find metallic or shrill yet serve as powerful vehicles for communication in their society. Additionally, they possess an advanced neural network that is designed to decode these complex combinations of colors and sounds, translating them into a comprehensive understanding of emotions, ideas, and intentions.\n\nIn terms of interpreting these patterns, the Zephyrian humanoids use a sophisticated collection of neural pathways that enabling them to process the data received from their senses. Unlike humans who rely on verbal language to communicate abstract concepts and emotions, these creatures process information holistically, with color and sound patterns providing a rich tapestry of information.\n\nFor instance, a single shade of blue might convey a feeling of tranquility or signify a loved one, while a quick, sharp note could denote excitement or danger. The combination of these elements allows them to express and interpret an incredible range of human emotions and intellectual concepts, like a musician creating a symphony or a painter crafting a masterpiece.\n\nUnderstanding and interpreting these patterns is innate to them. They are born equipped with this ability, much like how humans learn to comprehend language from an early age. While their cognitive and neural processes may be different from ours, they experience and process these multi-sensory patterns in a way that's natural and intuitive to them. This capability is an integral part of their identity, shaping their culture, social dynamics, and daily interactions.", "The Zephyrian humanoid possesses a highly developed sensory system that allows it to perceive and interpret the color and sound patterns produced by its own species. \n\nFor color patterns, the creature's eyes are far more advanced than human eyes. They can perceive a wider spectrum of colors, including ultraviolet and infrared, and are capable of detecting minute changes in hue and pattern. This allows them to interpret the complex color displays produced by their scales. \n\nMoreover, their brains are wired to process these visual signals in a way that is fundamentally different from humans. Where we see color as a static property, they perceive it as a dynamic, ever-changing aspect of their environment. They are capable of discerning subtle shifts in color and pattern that convey a wealth of information, from the emotional state of the individual to the intricacies of abstract concepts.\n\nAs for sound patterns, the creature's auditory system is equally advanced. They can hear a broader range of frequencies than humans, and their brains are capable of analyzing the complex melodies produced by their species. They can discern the pitch, rhythm, and harmony of these melodies, interpreting them as distinct 'words' or 'phrases' in their language.\n\nIn addition, the creature's auditory and visual senses are closely linked, allowing it to process color and sound patterns simultaneously. This sensory integration enables the creature to understand the full depth and complexity of its species' communication, as each melody enhances the meaning of the color patterns, and vice versa.\n\nInterestingly, this form of communication also has a strong emotional component. The creature doesn't just understand the literal meaning of the color and sound patterns; it also experiences an emotional response to them. A soothing melody accompanied by soft, cool colors might evoke a sense of calm, while a rapid, high-pitched melody with bright, flashing colors could induce excitement or alarm.\n\nIn this way, the Zephyrian humanoid's perception of its own species' communication is not just a cognitive process, but an emotional and sensory experience that encompasses a wide range of stimuli and responses." ], "system": "You are an artificial intelligence assistant. The assistant gives helpful, very detailed, and polite answers to the user's questions. You should respond with a very helpful, accurate, thruthful and harmless response." },

Expected behavior

No response

System Info

No response

Others

No response

hiyouga commented 5 months ago

please manually convert the dataset into the format mentioned in https://github.com/hiyouga/LLaMA-Factory/blob/main/data/README.md